From 92c281453fbb99f915c124a01addeaf79191b555 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Wed, 26 Jun 2013 09:18:48 -0400 Subject: [PATCH 1/3] Add Disqus comments to post layout --- _config.yml | 1 + _includes/disqus_comments.html | 21 +++++++++++++++++++++ _includes/scripts.html | 3 ++- _layouts/post.html | 2 ++ 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 _includes/disqus_comments.html diff --git a/_config.yml b/_config.yml index 7a62d34..0d26ace 100644 --- a/_config.yml +++ b/_config.yml @@ -1,6 +1,7 @@ title: So Simple Theme description: A simple and clean responsive Jekyll theme for words and photos. logo: site-logo.png +disqus_shortname: sosimpletheme #Comment out url when working locally to resolve base urls correctly url: http://mmistakes.github.io/so-simple-theme 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 afdb812..0402cb2 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -15,4 +15,5 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); - \ No newline at end of file + +{% include disqus_comments.html %} \ No newline at end of file diff --git a/_layouts/post.html b/_layouts/post.html index 01fea71..f9d8d38 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -24,10 +24,12 @@ {{ site.owner.name }} photo + {% if page.comments %}Comment{% endif %} Permalink
{{ content }} + {% if page.comments %}
{% endif %}
From 964df5ac898bed57ca9a2edf0d344b350744e376 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Wed, 26 Jun 2013 09:22:10 -0400 Subject: [PATCH 2/3] Enable comments --- _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-06-25-video-post.md | 1 + 5 files changed, 5 insertions(+) diff --git a/_posts/2011-03-10-sample-post.md b/_posts/2011-03-10-sample-post.md index 2e56259..3d3acaa 100644 --- a/_posts/2011-03-10-sample-post.md +++ b/_posts/2011-03-10-sample-post.md @@ -7,6 +7,7 @@ category: articles tags: [sample post] image: feature: so-simple-sample-image-1.jpg +comments: 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 faff163..ade68da 100644 --- a/_posts/2012-05-22-readability-post.md +++ b/_posts/2012-05-22-readability-post.md @@ -6,6 +6,7 @@ category: articles tags: [sample post, readability, test, intro] image: feature: so-simple-sample-image-2.jpg +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 4a8e353..76de7b7 100644 --- a/_posts/2013-05-22-sample-post-images.md +++ b/_posts/2013-05-22-sample-post-images.md @@ -4,6 +4,7 @@ title: "A Post with Images" description: "Examples and code for displaying images in posts." category: articles 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 ae8160b..0acdc1c 100644 --- a/_posts/2013-05-23-readability-feature-post.md +++ b/_posts/2013-05-23-readability-feature-post.md @@ -6,6 +6,7 @@ category: articles tags: [sample post, readability] image: feature: so-simple-sample-image-3.jpg +comments: 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 762ecd5..bbfb7d0 100644 --- a/_posts/2013-06-25-video-post.md +++ b/_posts/2013-06-25-video-post.md @@ -4,6 +4,7 @@ title: "A Post with a Video" description: "Custom written post descriptions are the way to go... if you're not lazy." category: articles tags: [sample post, video] +comments: true --- From 9853b1572acc6fb8611d3b193d566e08bf39f083 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Wed, 26 Jun 2013 09:31:45 -0400 Subject: [PATCH 3/3] Document adding Disqus comments to a post. --- README.md | 12 ++++++++++-- about.md | 1 + theme-setup.md | 8 ++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c201b17..2dda4a2 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,14 @@ so-simple-theme/ Most of the variables found here are used in the .html files found in `_includes` if you need to add or remove anything. A good place to start would be to change the title, tagline, description, and url of your site. When working locally comment out `url` or else you will get a bunch of broken links because they are absolute and prefixed with `{{ site.url }}` in the various `_includes` and `_layouts`. Just remember to uncomment `url` when building for deployment or pushing to **gh-pages**... +#### Disqus Comments + +Create a [Disqus](http://disqus.com) account and change `disqus_shortname` in `_config.yml` to the Disqus *shortname* you just setup. To enable commenting on a post, add the following to its front matter: + +``` yaml +comments: true +``` + #### Owner/Author Information Change your name, and avatar photo (200x200 pixels or larger), email, and social networking urls. If you want to link to an external image on Gravatar or something similiar you'll need to edit the path in `head.html` since it assumes it is located in `/images`. @@ -149,8 +157,8 @@ To make things easier I use LESS to build So Simple Theme's stylesheets. If you // -------------------------------------------------- @body-color : #ebebeb; @text-color : #333; -@base-color : #343434; -@comp-color : spin(@base-color, 180); +@base-color : #343434; +@comp-color : spin(@base-color, 180); @border-color : @base-color; @white : #fff; @black : #000; diff --git a/about.md b/about.md index 7ba1c14..a14eab2 100644 --- a/about.md +++ b/about.md @@ -16,6 +16,7 @@ Looking for a simple, responsive, theme for your Jekyll powered blog? Well look * Minimal embellishments and subtle animations. * Readable typography to make your words shine. * Support for large images to call out your favorite posts. +* Disqus comments if you choose to enable. * Simple and clear permalink structure[^1]. * Tags for [Open Graph](https://developers.facebook.com/docs/opengraph/) and [Twitter Cards](https://dev.twitter.com/docs/cards) for a better social sharing experience. diff --git a/theme-setup.md b/theme-setup.md index e883707..e74ffdb 100644 --- a/theme-setup.md +++ b/theme-setup.md @@ -48,6 +48,14 @@ so-simple-theme/ Most of the variables found here are used in the .html files found in `_includes` if you need to add or remove anything. A good place to start would be to change the title, tagline, description, and url of your site. When working locally comment out `url`[^1] or else you will get a bunch of broken links because they are absolute and prefixed with `{{ "{{ site.url " }}}}` in the various `_includes` and `_layouts`. Just remember to uncomment `url` when building for deployment or pushing to **gh-pages**... +#### Disqus Comments + +Create a [Disqus](http://disqus.com) account and change `disqus_shortname` in `_config.yml` to the Disqus *shortname* you just setup. To enable commenting on a post, add the following to its front matter: + +{% highlight yaml %} +comments: true +{% endhighlight %} + #### Owner/Author Information Change your name, and avatar photo (200x200 pixels or larger), email, and social networking urls. If you want to link to an external image on Gravatar or something similiar you'll need to edit the path in `head.html` since it assumes it is located in `/images`.