Skip to content

Commit

Permalink
Simplify social.html.
Browse files Browse the repository at this point in the history
This also fixes the wrong usage of `site.description` instead of `page.description` in meta description.
  • Loading branch information
XhmikosR committed Oct 20, 2017
1 parent 9a1d81f commit dd613d3
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions _includes/social.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,20 @@
<!-- Meta -->
<meta name="description" content="{{ site.description }}">
<meta name="description" content="{{ page.description | default: site.description }}">
<meta name="author" content="{{ site.authors }}">

<!-- Twitter -->
<meta name="twitter:card" content="{% if page.title %}summary{% else %}summary_large_image{% endif %}">
<meta name="twitter:site" content="@{{ site.twitter }}">
<meta name="twitter:creator" content="@{{ site.twitter }}">

{% if page.title %}
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="{{ page.title }}">
<meta name="twitter:description" content="{{ page.description }}">
<meta name="twitter:image" content="{{ site.url }}{{ site.social_logo_path }}">
{% else %}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ site.title }}">
<meta name="twitter:description" content="{{ site.description }}">
<meta name="twitter:image" content="{{ site.url }}{{ site.social_image_path }}">
{% endif %}
<meta name="twitter:title" content="{{ page.title | default: site.title }}">
<meta name="twitter:description" content="{{ page.description | default: site.description }}">
<meta name="twitter:image" content="{{ site.url }}{{ site.social_image_path }}">

<!-- Facebook -->
{% if page.title %}
<meta property="og:url" content="{{ site.url }}{{ page.url }}">
<meta property="og:title" content="{{ page.title }}">
<meta property="og:description" content="{{ page.description }}">
<meta property="og:type" content="website">
{% else %}
<meta property="og:url" content="{{ site.url }}">
<meta property="og:title" content="{{ site.title }}">
<meta property="og:description" content="{{ site.description }}">
{% endif %}
<meta property="og:url" content="{{ site.url }}{{ page.url }}">
<meta property="og:title" content="{{ page.title | default: site.title }}">
<meta property="og:description" content="{{ page.description | default: site.description }}">
<meta property="og:type" content="website">
<meta property="og:image" content="{{ site.url | replace: 'https://', 'http://' }}{{ site.social_image_path }}">
<meta property="og:image:secure_url" content="{{ site.url }}{{ site.social_image_path }}">
<meta property="og:image:type" content="image/png">
Expand Down

0 comments on commit dd613d3

Please sign in to comment.