From f708b13b8c32de9e2fd2f3247ace22178aa3303d Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Thu, 2 Jan 2014 11:55:49 -0500 Subject: [PATCH] Add support for simple social sharing links to posts --- _layouts/post.html | 8 ++++++++ _posts/2011-03-10-sample-post.md | 3 ++- _posts/2012-05-22-readability-post.md | 3 ++- _posts/2013-05-22-sample-post-images.md | 3 ++- _posts/2013-05-23-readability-feature-post.md | 3 ++- _posts/2013-06-25-video-post.md | 1 + _posts/2013-08-16-code-highlighting-post.md | 3 ++- theme-setup.md | 8 ++++++++ 8 files changed, 27 insertions(+), 5 deletions(-) diff --git a/_layouts/post.html b/_layouts/post.html index 261a81f..b3610b3 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -30,6 +30,14 @@ {% if page.modified %}{% endif %} {% if site.disqus_shortname and page.comments %} Comment{% endif %} + {% if page.share %} + + Like + + Tweet + + +1 + {% endif %}
{{ content }} diff --git a/_posts/2011-03-10-sample-post.md b/_posts/2011-03-10-sample-post.md index 0499eca..3c41627 100644 --- a/_posts/2011-03-10-sample-post.md +++ b/_posts/2011-03-10-sample-post.md @@ -9,7 +9,8 @@ image: feature: so-simple-sample-image-1.jpg credit: Michael Rose creditlink: http://mademistakes.com -comments: true +comments: true +share: true --- Below is just about everything you'll need to style in the theme. Check the source code to see the many embedded elements within paragraphs. diff --git a/_posts/2012-05-22-readability-post.md b/_posts/2012-05-22-readability-post.md index f3036fc..f4095a1 100644 --- a/_posts/2012-05-22-readability-post.md +++ b/_posts/2012-05-22-readability-post.md @@ -8,7 +8,8 @@ image: feature: so-simple-sample-image-2.jpg credit: Michael Rose creditlink: http://mademistakes.com -comments: true +comments: true +share: true --- Portland in shoreditch Vice, labore typewriter pariatur hoodie fap sartorial Austin. Pinterest literally occupy Schlitz forage. Odio ad blue bottle vinyl, 90's narwhal commodo bitters pour-over nostrud. Ugh est hashtag in, fingerstache adipisicing laboris esse Pinterest shabby chic Portland. Shoreditch bicycle rights anim, flexitarian laboris put a bird on it vinyl cupidatat narwhal. Hashtag artisan skateboard, flannel Bushwick nesciunt salvia aute fixie do plaid post-ironic dolor McSweeney's. Cliche pour-over chambray nulla four loko skateboard sapiente hashtag. diff --git a/_posts/2013-05-22-sample-post-images.md b/_posts/2013-05-22-sample-post-images.md index 59a04ec..b84fdd4 100644 --- a/_posts/2013-05-22-sample-post-images.md +++ b/_posts/2013-05-22-sample-post-images.md @@ -4,7 +4,8 @@ title: "A Post with Images" description: "Examples and code for displaying images in posts." category: articles tags: [sample post, images, test] -comments: true +comments: true +share: true --- Here are some examples of what a post with images might look like. If you want to display two or three images next to each other responsively use `figure` with the appropriate `class`. Each instance of `figure` is auto-numbered and displayed in the caption. diff --git a/_posts/2013-05-23-readability-feature-post.md b/_posts/2013-05-23-readability-feature-post.md index fb5b972..3ca1743 100644 --- a/_posts/2013-05-23-readability-feature-post.md +++ b/_posts/2013-05-23-readability-feature-post.md @@ -9,7 +9,8 @@ image: feature: so-simple-sample-image-3.jpg credit: Michael Rose creditlink: http://mademistakes.com -comments: true +comments: true +share: true --- This is a sample post with a large feature image[^1] up top and tons of text. Odio ad blue bottle vinyl, 90's narwhal commodo bitters pour-over nostrud. Ugh est hashtag in, fingerstache adipisicing laboris esse Pinterest shabby chic Portland. Shoreditch bicycle rights anim, flexitarian laboris put a bird on it vinyl cupidatat narwhal. Hashtag artisan skateboard, flannel Bushwick nesciunt salvia aute fixie do plaid post-ironic dolor McSweeney's. Cliche pour-over chambray nulla four loko skateboard sapiente hashtag. diff --git a/_posts/2013-06-25-video-post.md b/_posts/2013-06-25-video-post.md index bbfb7d0..2dae191 100644 --- a/_posts/2013-06-25-video-post.md +++ b/_posts/2013-06-25-video-post.md @@ -5,6 +5,7 @@ description: "Custom written post descriptions are the way to go... if you're no category: articles tags: [sample post, video] comments: true +share: true --- diff --git a/_posts/2013-08-16-code-highlighting-post.md b/_posts/2013-08-16-code-highlighting-post.md index c24d3bd..10e8a76 100644 --- a/_posts/2013-08-16-code-highlighting-post.md +++ b/_posts/2013-08-16-code-highlighting-post.md @@ -8,7 +8,8 @@ image: feature: so-simple-sample-image-5.jpg credit: Michael Rose creditlink: http://mademistakes.com -comments: true +comments: true +share: true --- Syntax highlighting is a feature that displays source code, in different colors and fonts according to the category of terms. This feature facilitates writing in a structured language such as a programming language or a markup language as both structures and syntax errors are visually distinct. Highlighting does not affect the meaning of the text itself; it is intended only for human readers.[^1] diff --git a/theme-setup.md b/theme-setup.md index 4d07310..d5a720e 100644 --- a/theme-setup.md +++ b/theme-setup.md @@ -231,6 +231,14 @@ Not sure if this only effects Kramdown or if it's an issue with Markdown in gene {% endhighlight %} +#### Social Share Links + +To enable Facebook, Twitter, and Google+ share links on a post or page, add the following to its front matter: + +{% highlight yaml %} +share: true +{% endhighlight %} + #### Twitter Cards Twitter cards make it possible to attach images and post summaries to Tweets that link to your content. Summary Card meta tags have been added to `head.html` to support this, you just need to [validate and apply your domain](https://dev.twitter.com/docs/cards) to turn it on.