Added meta tags to posts
Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
@ -6,6 +6,29 @@
|
|||||||
<meta name="description"
|
<meta name="description"
|
||||||
content='{% if page.excerpt %}{{ page.excerpt | strip_html | strip | truncatewords: 75 }}{% elsif page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}'>
|
content='{% if page.excerpt %}{{ page.excerpt | strip_html | strip | truncatewords: 75 }}{% elsif page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}'>
|
||||||
|
|
||||||
|
<meta property="og:site_name" content="{{ site.title }}">
|
||||||
|
{% if page.title %}
|
||||||
|
<meta property="og:title" content="{{ page.title }}">
|
||||||
|
<meta property="og:type" content="article">
|
||||||
|
<meta property="og:description" content="{{ page.excerpt | strip_html }}"/>
|
||||||
|
{% else %}
|
||||||
|
<meta property="og:title" content="{{ site.title }}">
|
||||||
|
<meta property="og:type" content="website">
|
||||||
|
<meta property="og:description" content="{{ site.description }}">
|
||||||
|
{% endif %}
|
||||||
|
{% if page.date %}
|
||||||
|
<meta property="article:published_time" content="{{ page.date | date_to_xmlschema }}">
|
||||||
|
{% endif %}
|
||||||
|
<meta property="og:url" content="{{ site.url }}{{ page.url }}" />
|
||||||
|
{% if page.tags %}
|
||||||
|
<meta itemprop="keywords" content="{{ page.tags | join: ',' }}" />
|
||||||
|
{% for tag in page.tags %}
|
||||||
|
<meta property="article:tag" content="{{ tag }}">
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
{% if author %}
|
||||||
|
<meta property="article:author" content="{{ author.name }}" />
|
||||||
|
{% endif %}
|
||||||
{% asset main.css %}
|
{% asset main.css %}
|
||||||
{% asset fa-svg-with-js.css %}
|
{% asset fa-svg-with-js.css %}
|
||||||
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
|
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
---
|
---
|
||||||
layout: default
|
layout: default
|
||||||
---
|
---
|
||||||
|
{% if page.date_modified %}
|
||||||
|
{% assign modified = page.date_modified %}
|
||||||
|
{% else %}
|
||||||
|
{% assign modified = page.date %}
|
||||||
|
{% endif %}
|
||||||
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
|
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
|
||||||
|
|
||||||
<header class="post-header">
|
<header class="post-header">
|
||||||
@ -10,6 +15,7 @@ layout: default
|
|||||||
<time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
|
<time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
|
||||||
{{ page.date | date: "%b %-d, %Y" }}
|
{{ page.date | date: "%b %-d, %Y" }}
|
||||||
</time>
|
</time>
|
||||||
|
<meta content="{{ modified | date_to_xmlschema }}" itemprop="dateModified" />
|
||||||
{% if page.author %} • <span class="far fa-user"></span>
|
{% if page.author %} • <span class="far fa-user"></span>
|
||||||
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
|
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
|
||||||
<span itemprop="name">{{ page.author }}</span>
|
<span itemprop="name">{{ page.author }}</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user