redesign seo/social media sharing parameters

This commit is contained in:
Dean Attali 2020-08-23 07:09:44 +00:00
parent 71a59841a0
commit 6a1b3cb343
6 changed files with 98 additions and 100 deletions

View file

@ -2,21 +2,33 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>{% if page.use-site-title %}{{ site.title }} {{ site.title-separator | default: '-' }} {{ site.description }}{% elsif page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
{%- capture title -%}
{%- if page.share-title -%}
{{ page.share-title }}
{%- elsif page.title -%}
{{ page.title }}
{%- else -%}
{{ site.title }}
{%- endif -%}
{%- endcapture -%}
{%- capture description -%}
{%- if page.share-description -%}
{{ page.share-description }}
{%- elsif page.subtitle -%}
{{ page.subtitle }}
{%- else -%}
{% assign excerpt_length = site.excerpt_length | default: 50 %}
{{ page.content | strip_html | xml_escape | truncatewords: excerpt_length }}
{%- endif -%}
{%- endcapture -%}
<title>{{ title }}</title>
{% if site.author %}
<meta name="author" content="{{ site.author }}">
{% endif %}
{%- capture description -%}
{%- if page.description -%}
{{ page.description }}
{%- elsif page.subtitle -%}
{{ page.subtitle }}
{%- else -%}
{{ site.description }}
{%- endif -%}
{%- endcapture -%}
<meta name="description" content="{{ description }}">
{% if site.mobile-theme-col %}
@ -27,7 +39,7 @@
<meta name="keywords" content="{{ site.keywords }}">
{% endif %}
<link rel="alternate" type="application/rss+xml" title="{{ site.title | default: 'Untitled' }} {{ site.title-separator | default: '-' }} {{ site.description }}" href="{{ '/feed.xml' | absolute_url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ '/feed.xml' | absolute_url }}">
{% include gtag.html %}
{% include gtm_head.html %}
@ -71,27 +83,7 @@
<meta property="og:site_name" content="{{ site.title }}">
{% endif %}
{%- capture share-title -%}
{%- if page.meta-title -%}
{{ page.meta-title }}
{%- elsif page.title -%}
{{ page.title }}
{%- else -%}
{{ site.title }}
{%- endif -%}
{%- endcapture -%}
{%- capture share-description -%}
{%- if page.meta-description -%}
{{ page.meta-description }}
{%- elsif page.subtitle -%}
{{ page.subtitle }}
{%- else -%}
{{ page.content | strip_html | xml_escape | truncatewords: 50 }}
{%- endif -%}
{%- endcapture -%}
{%- capture share-img -%}
{%- capture img -%}
{%- if page.share-img -%}
{{ page.share-img }}
{%- elsif page.cover-img -%}
@ -106,33 +98,28 @@
{{ site.avatar }}
{% endif %}
{%- endcapture -%}
{%- assign share-img=share-img | strip -%}
{%- assign img=img | strip -%}
<meta property="og:title" content="{{ share-title }}">
<meta property="og:description" content="{{ share-description }}">
<meta property="og:title" content="{{ title }}">
<meta property="og:description" content="{{ description }}">
{% if share-img != "" %}
<meta property="og:image" content="{{ share-img | absolute_url }}">
{% if img != "" %}
<meta property="og:image" content="{{ img | absolute_url }}">
{% endif %}
{% if page.id %}
<meta property="og:type" content="article">
<meta property="og:article:author" content="{{ site.author }}">
<meta property="og:article:published_time" content="{{ page.date | date_to_xmlschema }}">
{% else %}
<meta property="og:type" content="website">
{% endif %}
{% if page.id %}
<meta property="og:url" content="{{ page.url | absolute_url }}">
<link rel="canonical" href="{{ page.url | absolute_url }}">
{% else %}
<meta property="og:type" content="website">
<meta property="og:url" content="{{ page.url | absolute_url | strip_index }}">
<link rel="canonical" href="{{ page.url | absolute_url | strip_index }}">
{% endif %}
{% if share-img != "" and share-img != site.avatar %}
{% if img != "" and img != site.avatar %}
<meta name="twitter:card" content="summary_large_image">
{% else %}
<meta name="twitter:card" content="summary">
@ -140,11 +127,11 @@
<meta name="twitter:site" content="@{{ site.social-network-links.twitter }}">
<meta name="twitter:creator" content="@{{ site.social-network-links.twitter }}">
<meta property="twitter:title" content="{{ share-title }}">
<meta property="twitter:description" content="{{ share-description }}">
<meta property="twitter:title" content="{{ title }}">
<meta property="twitter:description" content="{{ description }}">
{% if share-img != "" %}
<meta name="twitter:image" content="{{ share-img | absolute_url }}">
{% if img != "" %}
<meta name="twitter:image" content="{{ img | absolute_url }}">
{% endif %}
{% if site.matomo %}

View file

@ -1,6 +1,6 @@
<ul class="list-inline text-center footer-links">
{%- if site.social-network-links.rss -%}
{%- if site.rss-description -%}
<li class="list-inline-item">
<a href="{{ '/feed.xml' | relative_url }}" title="RSS">
<span class="fa-stack fa-lg" aria-hidden="true">