From b10913e70da2757a1628a2ffe5b1752556ad9bab Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Sun, 28 Jun 2015 03:47:46 +0200 Subject: [PATCH] Added DISQUS comments and tabbed comment section. --- _includes/comments.html | 30 ++++++++++++++++++++++++++++-- _layouts/default.html | 2 ++ css/comments.sass | 26 ++++++++++++++++++++++++++ javascripts/comments.coffee | 11 +++++++++++ 4 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 css/comments.sass create mode 100644 javascripts/comments.coffee diff --git a/_includes/comments.html b/_includes/comments.html index 746140a..ff0e395 100644 --- a/_includes/comments.html +++ b/_includes/comments.html @@ -1,2 +1,28 @@ - -
Loading Google+ comments...
+ + +
+
+ + +
+ +
+ +
Loading Google+ comments...
+
diff --git a/_layouts/default.html b/_layouts/default.html index b87a573..f425f96 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -8,6 +8,7 @@ + @@ -26,6 +27,7 @@ {% endif %} + diff --git a/css/comments.sass b/css/comments.sass new file mode 100644 index 0000000..558e9a6 --- /dev/null +++ b/css/comments.sass @@ -0,0 +1,26 @@ +--- +--- +#comments-tabs + list-style: none + margin: 0 + padding: 0 + + li + background: none + display: inline-block + padding: 10px 15px + cursor: pointer + + li:before + content: normal + + li.current + background: rgba(black, 0.1) + +.comments-tab + display: none + padding: 1em + background: rgba(black, 0.1) + +.comments-tab.current + display: inherit diff --git a/javascripts/comments.coffee b/javascripts/comments.coffee new file mode 100644 index 0000000..5aec1eb --- /dev/null +++ b/javascripts/comments.coffee @@ -0,0 +1,11 @@ +--- +--- +$(document).ready -> + $('ul#comments-tabs li').click -> + tab_id = $(this).attr 'data-div' + + $('ul#comments-tabs li').removeClass 'current' + $('.comments-tab').removeClass 'current' + + $(this).addClass 'current' + $("##{tab_id}").addClass 'current'