From 2f52973d5286febcb96655195a8e76872cd88f64 Mon Sep 17 00:00:00 2001 From: Miguel de Moura Date: Tue, 6 Jun 2017 15:19:08 +0100 Subject: [PATCH] Improve thumbnail generation for social networks Fix #65 --- _includes/head.html | 13 +++++++++++-- ...016-10-15-chalk-sample-post-with-all-elements.md | 2 +- _posts/2016-10-17-introducing-chalk.md | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/_includes/head.html b/_includes/head.html index 0f0c02e9342a4..d25c4e84dc5ec 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -1,3 +1,12 @@ +{% if page.thumb_image %} + {% if page.thumb_image contains '://' %} + {% assign thumb_image = page.thumb_image %} + {% else %} + {% assign thumb_image = page.thumb_image | asset_path | absolute_url %} + {% endif %} +{% else %} + {% assign thumb_image = 'og-image.jpg' | asset_path | absolute_url %} +{% endif %} @@ -10,13 +19,13 @@ - + - + diff --git a/_posts/2016-10-15-chalk-sample-post-with-all-elements.md b/_posts/2016-10-15-chalk-sample-post-with-all-elements.md index 3c33c65b629a3..2c5b56f690ebc 100644 --- a/_posts/2016-10-15-chalk-sample-post-with-all-elements.md +++ b/_posts/2016-10-15-chalk-sample-post-with-all-elements.md @@ -2,7 +2,7 @@ layout: post title: "Chalk sample post with all elements" description: "Have a look at all the predesigned elements you can use in Chalk." -og_image: "documentation/sample-image.jpg" +thumb_image: "documentation/sample-image.jpg" tags: [design, jekyll] --- diff --git a/_posts/2016-10-17-introducing-chalk.md b/_posts/2016-10-17-introducing-chalk.md index d70fbb4db745f..ebe347fe44897 100644 --- a/_posts/2016-10-17-introducing-chalk.md +++ b/_posts/2016-10-17-introducing-chalk.md @@ -2,6 +2,7 @@ layout: post title: "Introducing chalk" description: "Chalk is a high quality, completely customizable, performant and 100% free blog template for Jekyll." +thumb_image: "documentation/sample-image.jpg" tags: [web, jekyll] ---