diff --git a/README.md b/README.md index b92ce9b..d3b77d4 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,20 @@ Just use the liquid tags `{% highlight python %}` and `{% endhighlight %}` to de
+#### Social media previews +The al-folio theme optionally supports preview images on social media. +To enable this functionality you will need to set `serve_og_meta` to `true` in +your `_config.yml`. Once you have done so, all your site's pages will include +Open Graph data in the HTML head element. + +You will then need to configure what image to display in your site's social +media previews. This can be configured on a per-page basis, by setting the +`og_image` page variable. If for an individual page this variable is not set, +then the theme will fall back to a site-wide `og_image` variable, configurable +in your `_config.yml`. In both the page-specific and site-wide cases, the +`og_image` variable needs to hold the URL for the image you wish to display in +social media previews. + ## Contributing Feel free to contribute new features and theme improvements by sending a pull request. diff --git a/_config.yml b/_config.yml index 6e16a74..f6673a9 100644 --- a/_config.yml +++ b/_config.yml @@ -14,6 +14,14 @@ url: # the base hostname & protocol for your site baseurl: /al-folio # the subpath of your site, e.g. /blog/ last_updated: # leave blank if you don't want to display last updated +# ----------------------------------------------------------------------------- +# Open Graph +# ----------------------------------------------------------------------------- +# Display links to the page with a preview object on social media. +# To achieve this, change serve_og_meta to true and then provide the URL of the +# preview image as the value of og_image. +serve_og_meta: false # Include Open Graph meta tags in the HTML head +og_image: # The site-wide (default for all links) Open Graph preview image # ----------------------------------------------------------------------------- # Social integration # ----------------------------------------------------------------------------- diff --git a/_includes/head.html b/_includes/head.html index 81df8e2..8c4eb1c 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -6,6 +6,16 @@