Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
112 lines (94 sloc) 3.98 KB
<!-- Update your html tag to include the itemscope and itemtype attributes. -->
<html itemscope itemtype="http://schema.org/Article">
{% if page.author.name %}
{% assign page_author = page.author.name | default: nil | escape %}
{% assign twitter_creator = page.twitter.username | default: site.twitter.site | default: nil | escape %}
{% else %}
{% assign page_author = site.author.name | default: nil | escape %}
{% assign twitter_creator = site.twitter.username | default: nil | escape %}
{% endif %}
{% assign page_description = page.excerpt | default: page.tagline | default: site.description | strip_html | normalize_whitespace | truncate: 300 | escape %}
{%if page.image %}
{% assign page_image = site.url | append: site.baseurl | append: page.image %}
{%else if site.image %}
{% assign page_image = site.url | append: site.baseurl | append: site.image %}
{%endif %}
{% assign canonical_url = page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url %}
{%if page_author %}
<meta name="author" content="{{ page_author }}" />
{%endif %}
<meta name="description" content="{{ page_description }}" />
{%if page.tags.size > 0 %}
<meta name="keywords" itemprop="tags" content="{{ page.tags | join: ', ' | escape }}" />
{%endif %}
{%if page.keywords %}
<meta name="keywords" itemprop="keywords" content="{{ page.keywords | escape }}" />
{%endif %}
{%if page.categories.size > 0 %}
<meta name="keywords" itemprop="categories" content="{{ page.categories | join: ', ' | escape }}" />
{%endif %}
{%if page.category %}
<meta name="keywords" itemprop="category" content="{{ category | escape }}" />
{%endif %}
<meta itemprop="name" content="{{ page_title }}" />
<meta itemprop="description" content="{{ page_description }}" />
{%if page_image %}
<meta itemprop="image" content="{{ page_image }}" />
{%endif %}
<!-- Twitter Card data -->
<meta name="twitter:card" content="summary_large_image" />
{%if site.twitter.site %}
<meta name="twitter:site" content="@{{ site.twitter.site }}" />
{%endif %}
<meta name="twitter:title" content="{{ page_title }}" />
<meta name="twitter:description" content="{{ page_description }}" />
{%if twitter_creator %}
<meta name="twitter:creator" content="@{{ twitter_creator }}" />
{%endif %}
<!-- Twitter summary card with large image must be at least 280x150px -->
{%if page_image %}
<meta name="twitter:image:src" content="{{ page_image }}" />
<meta name="twitter:image" content="{{ page_image }}" />
{%endif %}
<meta name="twitter:url" content="{{ canonical_url }}" />
<!-- Open Graph data -->
<meta property="og:title" content="{{ page_title }}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="{{ canonical_url }}" />
{%if page_image %}
<meta property="og:image" content="{{ page_image }}" />
{%endif %}
<meta property="og:description" content="{{ page_description }}" />
<meta property="og:site_name" content="{{ site.title }}" />
{% if page-lang == "en" %}
{% assign page-lang-country = "en_US" %}
{% elsif page-lang == "pt" %}
{% assign page-lang-country = "pt_BR" %}
{% endif %}
<meta property="og:locale" content="{{ page-lang-country }}" />
{%if page.date %}
<meta property="article:published_time" content="{{ page.date | date_to_xmlschema }}" />
{%endif %}
{%if page.modified_date %}
<meta property="og:updated_time" content="{{ page.modified_date | date_to_xmlschema }}" />
<meta property="article:modified_time" content="{{ page.modified_date | date_to_xmlschema }}" />
{%endif %}
{%if page.tags %}
{% for tag in page.tags %}
<meta property="article:tag" content="{{ tag | escape }}" />
{% endfor %}
{%endif %}
{%if page.keywords %}
{% assign keywordsList = page.keywords | split:', ' %}
{% for keyword in keywordsList %}
<meta property="article:tag" content="{{ keyword | escape }}" />
{% endfor %}
{%endif %}
{%if page.categories %}
{% for category in page.categories %}
<meta property="article:tag" content="{{ category | escape }}" />
{% endfor %}
{%endif %}
{%if page.category %}
<meta property="article:tag" content="{{ category | escape }}" />
{%endif %}
You can’t perform that action at this time.