diff --git a/README.md b/README.md index 1a222dd..61e15e1 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Tale is a minimal Jekyll theme curated for storytellers. Checkout the demo [here - Syntax highlighting, with the help of Pygments - Markdown and HTML text formatting - Pagination of posts +- [Enabling Comments (via Disqus)](#enabling-comments-via-disqus) ## Installation There are 3 ways to install this theme @@ -112,6 +113,21 @@ $ bundle exec jekyll serve And you're all set! Head over to http://127.0.0.1:4000/ to see your site in action. + +### Enabling Comments (via Disqus) + +Optionally, if you have a Disqus account, you can tell Jekyll to use it to show a comments section below each post. + +To enable it, add the following lines to your Jekyll site: + +```yml +disqus: your_disqus_id +``` + +You can find out more about Disqus' shortnames [here](https://help.disqus.com/installation/whats-a-shortname). + +Comments are disabled by default and will only appear in when adding `comments: true` to that post's YAML Front Matter + ## Contributing Found a bug or have a suggestion? Feel free to create an issue or make a pull request! diff --git a/_data/theme.yml b/_data/theme.yml new file mode 100644 index 0000000..5594052 --- /dev/null +++ b/_data/theme.yml @@ -0,0 +1,2 @@ +# Disqus +disqus: your_disqus_id \ No newline at end of file diff --git a/_includes/disqus_comment.html b/_includes/disqus_comment.html new file mode 100644 index 0000000..c895db6 --- /dev/null +++ b/_includes/disqus_comment.html @@ -0,0 +1,30 @@ + + +

Discussion and feedback

+
+
+ + + + \ No newline at end of file diff --git a/_layouts/post.html b/_layouts/post.html index 786d0db..ae4eb5e 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -23,7 +23,9 @@ layout: default {{ content }} - +{% if page.comments %} + {% include disqus_comment.html %} +{% endif %} + \ No newline at end of file diff --git a/_posts/2017-03-29-introducing-tale.md b/_posts/2017-03-29-introducing-tale.md index 95da685..71cfcef 100644 --- a/_posts/2017-03-29-introducing-tale.md +++ b/_posts/2017-03-29-introducing-tale.md @@ -2,6 +2,7 @@ layout: post title: "Introducing Tale" author: "Chester" +comments: true --- Tale is a minimal [Jekyll](https://jekyllrb.com/) theme curated for storytellers. It is designed and developed by [myself](https://github.com/chesterhow/) for a friend who writes short stories. diff --git a/assets/js/disqusLoader.js b/assets/js/disqusLoader.js new file mode 100644 index 0000000..935aa92 --- /dev/null +++ b/assets/js/disqusLoader.js @@ -0,0 +1,11 @@ + + /* + disqusLoader.js v1.0 + A JavaScript plugin for lazy-loading Disqus comments widget. + - + By Osvaldas Valutis, www.osvaldas.info + Available for use under the MIT License + */ + (function(b,f,l){var r=function(a){a=a.getBoundingClientRect();return{top:a.top+f.body.scrollTop,left:a.left+f.body.scrollLeft}},t=function(a,c){var d=f.createElement("script");d.src=a;d.async=!0;d.setAttribute("data-timestamp",+new Date);d.addEventListener("load",function(){"function"===typeof c&&c()});(f.head||f.body).appendChild(d)};l=function(a,c){var d,e;return function(){var g=this,f=arguments,b=+new Date;d&&bb.innerHeight*n||0 0.10.0" spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.5.0" - spec.add_development_dependency "bundler", "~> 1.12" + spec.add_development_dependency "bundler", "~> 2.0" spec.add_development_dependency "rake", "~> 10.0" end