changeset 159:d8eb48d642d1

Add Open Graph protocol meta data for social media sharing.
author Kai T. Ohlhus <k.ohlhus@gmail.com>
date Thu, 06 Sep 2018 20:15:57 +0200
parents f5d07829a487
children 6f7960fdca0e
files _includes/head.html
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/_includes/head.html	Wed Aug 15 08:41:19 2018 +0200
+++ b/_includes/head.html	Thu Sep 06 20:15:57 2018 +0200
@@ -4,7 +4,13 @@
   <meta name="viewport" content="width=device-width, initial-scale=1">
 
   <title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
-  <meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
+  <meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | lstrip | rstrip | truncate: 140 }}{% else %}{{ site.description | strip_html | lstrip | rstrip | truncate: 140 }}{% endif %}">
+  <meta property="og:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
+  <meta property="og:description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | lstrip | rstrip | truncate: 140 }}{% else %}{{ site.description | strip_html | lstrip | rstrip | truncate: 140 }}{% endif %}">
+  <meta property="og:image" content="https://www.gnu.org/software/octave/img/octave-logo.svg">
+  <meta property="og:image:alt" content="GNU Octave">
+  <meta property="og:type" content="website">
+  <meta property="og:url" content="{{ page.url | absolute_url }}">
 
   <link rel="stylesheet" href="{{ "/css/foundation.min.css" | relative_url }}">
   <link rel="stylesheet" href="{{ "/css/normalize.css" | relative_url }}">