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)
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
<section class="post-content">
|
||||
<div class="content">
|
||||
<?php echo $post->getContentHtml() ?>
|
||||
|
@ -30,6 +30,6 @@
|
|||
<?php if ($post->hasAuthor()): ?>
|
||||
<?php echo View::render('content/_postAuthor', ['post' => $post]) ?>
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
</main>
|
||||
<?php echo View::render('nav/_footer') ?>
|
||||
|
|
Loading…
Add table
Reference in a new issue