Skip to content

Commit

Permalink
Add Open Graph support for Linkedin (#64)
Browse files Browse the repository at this point in the history
* added prefix tag to support Open Graph on Linkedin

* added prefix tag to support Open Graph on Linkedin
  • Loading branch information
eternaltinkering authored Aug 2, 2021
1 parent b7c3285 commit fbe73a2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
14 changes: 7 additions & 7 deletions templates/partials/og.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
{% for admin in FACEBOOK_ADMINS %}
<meta property="fb:admins" content="{{ admin }}" />
{% endfor %}
<meta property="og:site_name" content="{{ SITENAME }}"/>
<meta property="og:type" content="blog"/>
<meta property="og:title" content="{{ SITENAME }}"/>
<meta property="og:description" content="{{ description }}"/>
<meta property="og:locale" content="{{ default_locale }}"/>
<meta property="og:url" content="{{ SITEURL }}/"/>
<meta property="og:image" content="{{ default_cover }}">
<meta prefix="og: http://ogp.me/ns#" property="og:site_name" content="{{ SITENAME }}"/>
<meta prefix="og: http://ogp.me/ns#" property="og:type" content="blog"/>
<meta prefix="og: http://ogp.me/ns#" property="og:title" content="{{ SITENAME }}"/>
<meta prefix="og: http://ogp.me/ns#" property="og:description" content="{{ description }}"/>
<meta prefix="og: http://ogp.me/ns#" property="og:locale" content="{{ default_locale }}"/>
<meta prefix="og: http://ogp.me/ns#" property="og:url" content="{{ SITEURL }}/"/>
<meta prefix="og: http://ogp.me/ns#" property="og:image" content="{{ default_cover }}">

<!-- Twitter Card -->
{% for name,link in SOCIAL if name.lower() in ['twitter'] %}
Expand Down
26 changes: 13 additions & 13 deletions templates/partials/og_article.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@
{% for admin in FACEBOOK_ADMINS %}
<meta property="fb:admins" content="{{ admin }}" />
{% endfor %}
<meta property="og:site_name" content="{{ SITENAME }}"/>
<meta property="og:title" content="{{ article.title|striptags }}"/>
<meta property="og:description" content="{{ description }}"/>
<meta property="og:locale" content="{{ article.metadata.get('og_locale', default_locale) }}"/>
<meta property="og:url" content="{{ SITEURL }}/{{ article.url }}"/>
<meta property="og:type" content="article"/>
<meta property="article:published_time" content="{{ article.date }}"/>
<meta property="article:modified_time" content="{{ article.modified }}"/>
<meta property="article:author" content="{{ SITEURL }}/{{ article.author.url }}">
<meta prefix="og: http://ogp.me/ns#" property="og:site_name" content="{{ SITENAME }}"/>
<meta prefix="og: http://ogp.me/ns#" property="og:title" content="{{ article.title|striptags }}"/>
<meta prefix="og: http://ogp.me/ns#" property="og:description" content="{{ description }}"/>
<meta prefix="og: http://ogp.me/ns#" property="og:locale" content="{{ article.metadata.get('og_locale', default_locale) }}"/>
<meta prefix="og: http://ogp.me/ns#" property="og:url" content="{{ SITEURL }}/{{ article.url }}"/>
<meta prefix="og: http://ogp.me/ns#" property="og:type" content="article"/>
<meta prefix="og: http://ogp.me/ns#" property="article:published_time" content="{{ article.date }}"/>
<meta prefix="og: http://ogp.me/ns#" property="article:modified_time" content="{{ article.modified }}"/>
<meta prefix="og: http://ogp.me/ns#" property="article:author" content="{{ SITEURL }}/{{ article.author.url }}">
{% for name,link in SOCIAL if name.lower() in ['facebook'] %}
<meta property="article:publisher" content="{{ link }}" />
<meta prefix="og: http://ogp.me/ns#" property="article:publisher" content="{{ link }}" />
{% endfor %}
<meta property="article:section" content="{{ article.category.name }}"/>
<meta prefix="og: http://ogp.me/ns#" property="article:section" content="{{ article.category.name }}"/>
{% for tag in article.tags %}
<meta property="article:tag" content="{{ tag.name }}"/>
<meta prefix="og: http://ogp.me/ns#" property="article:tag" content="{{ tag.name }}"/>
{% endfor %}
<meta property="og:image" content="{{ default_cover }}">
<meta prefix="og: http://ogp.me/ns#" property="og:image" content="{{ default_cover }}">

<!-- Twitter Card -->
{% for name,link in SOCIAL if name.lower() in ['twitter'] %}
Expand Down

0 comments on commit fbe73a2

Please sign in to comment.