From abf1334585282a27be7d16c973f79480fc754e45 Mon Sep 17 00:00:00 2001 From: Dean Attali Date: Wed, 20 Jul 2016 15:00:09 -0700 Subject: [PATCH] add support for twitter cards (sharing on Twitter will be better); fixes #70 --- README.md | 2 +- _includes/head.html | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1b5e58e..61df15a 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ subtitle | Short description of page or blog post that goes under the title bigimg | Include a large full-width image at the top of the page. You can either give the path to a single image, or provide a list of images to cycle through (see [my personal website](http://deanattali.com/) as an example). comments | If you want do add Disqus comments to a specific page, use `comments: true`. Comments are automatically enabled on blog posts; to turn comments off for a specific post, use `comments: false`. Comments only work if you set your Disqus id in the `_config.yml` file. show-avatar | If you have an avatar configured in the `_config.yml` but you want to turn it off on a specific page, use `show-avatar: false`. If you want to turn it off by default, locate the line `show-avatar: true` in the file `_config.yml` and change the `true` to `false`; then you can selectively turn it on in specific pages using `show-avatar: true`. -fb-img | If you want to share a page on Facebook, by default Facebook will use the first image it can find on the page. If you want to specify an image to use when sharing the page on Facebook, then provide the image's URL here +share-img | If you want to specify an image to use when sharing the page on Facebook or Twitter, then provide the image's full URL here. layout | What type of page this is (default is `blog` for blog posts and `page` for other pages. You can use `minimal` if you don't want a header and footer) js | List of local JavaScript files to include in the page (eg. `/js/mypage.js`) ext-js | List of external JavaScript files to include in the page (eg. `//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.2/underscore-min.js`) diff --git a/_includes/head.html b/_includes/head.html index ae929a1..e371d9c 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -52,19 +52,30 @@ - {% if page.id %} {% else %} {% endif %} - - {% if page.fb-img %} - + {% if page.share-img %} + {% elsif site.avatar %} {% else %} {% endif %} + + + + + + + + {% if page.share-img %} + + {% elsif site.avatar %} + + {% endif %} +