mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
allow setting of open graph image in blog posts
This commit is contained in:
parent
f039ddf660
commit
ed8fec9c4d
3 changed files with 11 additions and 5 deletions
|
@ -3,6 +3,7 @@ author: jeremy-kauffman
|
|||
title: 'Hacktoberfest 2019!'
|
||||
date: '2019-10-01 11:37:00'
|
||||
cover: 'Hacktoberfest.jpg'
|
||||
og: 'https://spee.ch/@lbryblog:e/hacktoberfest2019.png'
|
||||
category: developers
|
||||
---
|
||||
|
||||
|
@ -44,12 +45,14 @@ Note: the chat link goes to LBRY’s main public chat. Post a message in binary*
|
|||
|
||||
Anyone who makes any contribution at all, even a one line typo fix, will receive a LBRY sticker.
|
||||
|
||||
Anyone who contributes anything of any substance* will receive a LBRY T-Shirt.
|
||||
Anyone who contributes anything of any substance* will receive a sticker, LBRY t-shirt, and more.
|
||||
|
||||
As always, anyone who contributes will receive LBC as [appreciation](https://lbry.com/faq/appreciation).
|
||||
And as always, anyone who contributes will receive LBC as [appreciation](https://lbry.com/faq/appreciation).
|
||||
|
||||
Additionally, this month only, every contributor, new or returning, will receive a 10,000 LBC bonus for their first PR of this month.
|
||||
|
||||
T-shirts and stickers will be the above Hacktoberfest image.
|
||||
|
||||
*We’re going to be very inclusive as counting PRs as substantive, but due to some people making drive-by PRs to earn shirts, we’ve introduced this additional qualifier.
|
||||
|
||||
## <a name="events"></a>Events
|
||||
|
|
|
@ -309,6 +309,11 @@ class Post
|
|||
{
|
||||
$urls = [];
|
||||
|
||||
$metadata = $this->getMetadata();
|
||||
if (isset($metadata['og']) && $metadata['og']) {
|
||||
$urls[] = $metadata['og'];
|
||||
}
|
||||
|
||||
$cover = $this->getCover();
|
||||
if ($cover) {
|
||||
$urls[] = 'https://' . Request::getHost() . '/img/blog-covers/' . $cover;
|
||||
|
@ -321,7 +326,7 @@ class Post
|
|||
$urls = array_merge($urls, $matches[1]);
|
||||
}
|
||||
|
||||
return $urls;
|
||||
return array_unique($urls);
|
||||
}
|
||||
|
||||
protected function markdownToText($markdown)
|
||||
|
|
|
@ -43,8 +43,6 @@
|
|||
<meta property="og:description" content="<?php echo Response::getMetaDescription() ?>"/>
|
||||
<?php foreach ($images as $image): ?>
|
||||
<meta property="og:image" content="<?php echo $image ?>"/>
|
||||
<meta property="og:image:height" content="1125"/>
|
||||
<meta property="og:image:width" content="2000"/>
|
||||
<?php endforeach ?>
|
||||
<meta property="og:site_name" content="LBRY"/>
|
||||
<meta property="og:title" content="<?php echo $title ?>"/>
|
||||
|
|
Loading…
Add table
Reference in a new issue