mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
meta image for blog post covers
This commit is contained in:
parent
8f8948c6ce
commit
cbccfa6e74
2 changed files with 17 additions and 3 deletions
|
@ -244,9 +244,23 @@ class Post
|
|||
|
||||
public function getImageUrls()
|
||||
{
|
||||
$urls = [];
|
||||
|
||||
$cover = $this->getCover();
|
||||
if ($cover)
|
||||
{
|
||||
$urls[] = 'https://' . $_SERVER['SERVER_NAME'] . '/img/' . $cover;
|
||||
}
|
||||
|
||||
$matches = [];
|
||||
preg_match_all('/!\[.*?\]\((.*?)\)/', $this->markdown, $matches);
|
||||
return $matches ? $matches[1] : [];
|
||||
|
||||
if ($matches)
|
||||
{
|
||||
$urls = array_merge($urls, $matches[1]);
|
||||
}
|
||||
|
||||
return $urls;
|
||||
}
|
||||
|
||||
protected function markdownToText($markdown)
|
||||
|
|
Loading…
Add table
Reference in a new issue