Skip to content

Commit

Permalink
Just Read: Extended metadata block
Browse files Browse the repository at this point in the history
This meta information is useful for integrating into the social media.
  • Loading branch information
schtobia committed Oct 11, 2017
1 parent d385652 commit b062aff
Showing 1 changed file with 46 additions and 2 deletions.
48 changes: 46 additions & 2 deletions Just-Read/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,52 @@
<head>
<meta charset="utf-8"/>
<title>{% block title %}{{ SITENAME }}{%endblock%}</title>
<meta name="author" content="{{ AUTHOR }}">


{% if article and article.author %}
<meta name="author" content="{{ article.author }}" />
<meta name="copyright" content="{{ article.author }}" />
{% elif page and page.author %}
<meta name="author" content="{{ page.author }}" />
<meta name="copyright" content="{{ page.author }}" />
{% else %}
<meta name="author" content="{{ AUTHOR }}" />
<meta name="copyright" content="{{ AUTHOR }}" />
{% endif %}

<meta property="og:site_name" content="{{SITENAME}}" />

{% if GOOGLE_PLUS_PROFILE_URL %}
<link rel="author" href={{GOOGLE_PLUS_PROFILE_URL}} />
{% endif %}
{%if TWITTER_USERNAME %}
<meta name="twitter:site" content="@{{TWITTER_USERNAME}}" />
<meta name="twitter:creator" content="@{{TWITTER_USERNAME}}" />
{% endif %}

{%if article %}
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="{{article.title}}" />
<meta name="date" content="{{article.date}}" />
<meta property="og:type" content="article" />
<meta property="og:locale" content="{{article.lang}}" />
<meta property="og:published_time" content="{{article.date}}" />
<meta property="og:title" content="{{article.title}}" />
<meta property="og:url" content="{{SITEURL}}/{{ article.url }}" />
{% if article.featured_image %}
<meta property="og:image" content="{{ article.featured_image }}" />
{% endif %}
{%if DESCRIPTION %}
<meta property="og:description" content="{{DESCRIPTION}} " />
<meta name="description" content="{{DESCRIPTION}}" />
{%else %}
<meta property="og:description" content="{{article.summary|striptags}}" />
<meta name="description" content="{{article.summary|striptags}}" />
{% endif %}
{%if FACEBOOK_PROFILE_URL %}
<meta property="article:author" content="{{FACEBOOK_PROFILE_URL}}" />
{% endif %}
{% endif %}

<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0">
Expand Down

0 comments on commit b062aff

Please sign in to comment.