-
Notifications
You must be signed in to change notification settings - Fork 60
Add open-graph page metadata for social sharing #76
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this. Now we won't see that default banner for every article shared!
_includes/block/head.html
Outdated
<meta property="og:url" content="{{ site.url }}{{ page.url}}"> | ||
|
||
{% if page.cover %} | ||
<meta name="og:image" content="{{ site.url }}{{ page.cover }}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update these to use the property
attribute instead of name
? I've been seeing these warnings in the Facebook debugger for the live site:
_includes/block/head.html
Outdated
{% else %} | ||
<meta name="og:image" content="{{ site.url }}/assets/images/banner.png"> | ||
{% endif %} | ||
|
||
{% if page.title %} | ||
<meta property="og:title" content="{% if page.title %}{{ page.title }} — {% endif %}{{ site.title }}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Since you are already in this file, would you mind fixing my redundant check around page.title
? No problem if you don't. This line can just be:
<meta property="og:title" content="{{ page.title }} — {{ site.title }}">
{% endif %} | ||
|
||
{% if page.title %} | ||
<meta name="twitter:title" content="{{ page.title }} | @GodaddyOSS"> | ||
{% endif %} | ||
|
||
{% if page.excerpt %} | ||
<meta property="og:description" content="{{ page.excerpt }}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: It would be nice to go through and give all top-level pages excerpts, but that is also fine to save for another PR.
@chrisvogt Thanks, pushed the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG. Thanks!
Reference: http://ogp.me/