Skip to content

Commit

Permalink
Merge branch 'adonig-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickfournier committed Jan 30, 2017
2 parents ad4eaaf + e0a7ca9 commit 83b5499
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Readme.rst
Expand Up @@ -34,11 +34,13 @@ article category and from these standard metadata tags:
- ``modified``
- ``tags``

Additionaly, the plugin also read these metadata tags:
Additionally, the plugin also reads these metadata tags:

- ``og_image``, an URL to an image that will represent your article;
- ``og_description``, a short description of your article. If not
provided, the description will be set to ``summary``, which is often
too long;
- ``og_locale``, the locale of your article (e.g. 'fr_CA'). If not provided,
the locale will be set to your Pelican settings ``LOCALE``.

Additionally, the plugin reads article.related_posts to set ``og:see_also``.
5 changes: 5 additions & 0 deletions open_graph.py
Expand Up @@ -89,6 +89,11 @@ def open_graph_tag(item):
ogtags.append(('article:modified_time', strftime(
item.modified, "%Y-%m-%d")))

if hasattr(item, 'related_posts'):
for related_post in item.related_posts:
url = os.path.join(item.settings.get('SITEURL', ''), related_post.url)
ogtags.append(('og:see_also', url))

author_fb_profiles = item.settings.get('AUTHOR_FB_ID', {})
if len(author_fb_profiles) > 0:
for author in item.authors:
Expand Down

0 comments on commit 83b5499

Please sign in to comment.