From 55d0059f87ab5a793fd41aa32b6269c549b4e63d Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Tue, 25 Mar 2014 17:25:21 +0100 Subject: [PATCH] add disqus comments as per hpstr theme --- _config.yml | 1 + _includes/_disqus_comments.html | 21 +++++++++++++++++++ _includes/_scripts.html | 3 +++ _layouts/page.html | 3 +++ _layouts/post.html | 3 +++ _posts/2011-03-10-sample-post.md | 1 + _posts/2012-05-22-readability-post.md | 1 + _posts/2013-05-22-sample-post-images.md | 1 + _posts/2013-05-23-readability-feature-post.md | 1 + _posts/2013-08-16-code-highlighting-post.md | 1 + about.md | 1 + 11 files changed, 37 insertions(+) create mode 100644 _includes/_disqus_comments.html diff --git a/_config.yml b/_config.yml index 59ea318..9521bb6 100644 --- a/_config.yml +++ b/_config.yml @@ -2,6 +2,7 @@ title: Site Title description: Describe your website. # Your site's domain goes here. Leave localhost server or blank when working locally. url: http://localhost:4000 +disqus_shortname: # Owner/author information owner: diff --git a/_includes/_disqus_comments.html b/_includes/_disqus_comments.html new file mode 100644 index 0000000..0e1f7e3 --- /dev/null +++ b/_includes/_disqus_comments.html @@ -0,0 +1,21 @@ + + +comments powered by Disqus \ No newline at end of file diff --git a/_includes/_scripts.html b/_includes/_scripts.html index 3a6045f..0af0902 100644 --- a/_includes/_scripts.html +++ b/_includes/_scripts.html @@ -17,4 +17,7 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); +{% endif %} +{% if page.comments %} + {% include _disqus_comments.html %} {% endif %} \ No newline at end of file diff --git a/_layouts/page.html b/_layouts/page.html index 62df57e..f9325ba 100644 --- a/_layouts/page.html +++ b/_layouts/page.html @@ -39,6 +39,9 @@
{{ content }}
+ {% if site.disqus_shortname and page.comments %} +
+ {% endif %} diff --git a/_layouts/post.html b/_layouts/post.html index 06d8bcc..439f90a 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -48,6 +48,9 @@

{{ page.title }} was published on {% if page.modified %} and last modified on {% endif %} by {{ site.owner.name }}.

+ {% if site.disqus_shortname and page.comments %} +
+ {% endif %} diff --git a/_posts/2011-03-10-sample-post.md b/_posts/2011-03-10-sample-post.md index bd54fec..57401a1 100644 --- a/_posts/2011-03-10-sample-post.md +++ b/_posts/2011-03-10-sample-post.md @@ -4,6 +4,7 @@ title: Sample Post description: "Just about everything you'll need to style in the theme: headings, paragraphs, blockquotes, tables, code blocks, and more." modified: 2013-05-31 tags: [intro, beginner, jekyll, tutorial] +comments: true image: feature: texture-feature-05.jpg credit: Texture Lovers diff --git a/_posts/2012-05-22-readability-post.md b/_posts/2012-05-22-readability-post.md index 0cd27a8..c5f99a9 100644 --- a/_posts/2012-05-22-readability-post.md +++ b/_posts/2012-05-22-readability-post.md @@ -3,6 +3,7 @@ layout: post title: "Testing Readability with a Bunch of Text" description: "A ton of text to test readability." tags: [sample post, readability, test] +comments: 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 6e8499f..4f65e36 100644 --- a/_posts/2013-05-22-sample-post-images.md +++ b/_posts/2013-05-22-sample-post-images.md @@ -3,6 +3,7 @@ layout: post title: "A Post with Images" description: "Examples and code for displaying images in posts." tags: [sample post, images, test] +comments: 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 93fb9c0..78d9fc3 100644 --- a/_posts/2013-05-23-readability-feature-post.md +++ b/_posts/2013-05-23-readability-feature-post.md @@ -3,6 +3,7 @@ layout: post title: "Post with Large Feature Image and Text" description: "Custom written post descriptions are the way to go... if you're not lazy." tags: [sample post, readability, test] +comments: true image: feature: texture-feature-04.jpg credit: Texture Lovers diff --git a/_posts/2013-08-16-code-highlighting-post.md b/_posts/2013-08-16-code-highlighting-post.md index 065da80..322baf0 100644 --- a/_posts/2013-08-16-code-highlighting-post.md +++ b/_posts/2013-08-16-code-highlighting-post.md @@ -3,6 +3,7 @@ layout: post title: Syntax Highlighting Post description: "Demo post displaying the various ways of highlighting code in Markdown." tags: [sample post, code, highlighting] +comments: true --- [Syntax highlighting](http://en.wikipedia.org/wiki/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. diff --git a/about.md b/about.md index 0bebb3f..1d1716e 100644 --- a/about.md +++ b/about.md @@ -5,6 +5,7 @@ title: About the Theme tagline: Minimal Mistakes, a Jekyll Theme tags: [about, Jekyll, theme, responsive] modified: 9-9-2013 +comments: true image: feature: texture-feature-02.jpg credit: Texture Lovers -- 2.45.2