Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
Add support for isso commenting system
Browse files Browse the repository at this point in the history
  • Loading branch information
scotte committed May 7, 2016
1 parent b2c83b6 commit 67774ed
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 11 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,27 @@ $ jekyll serve --baseurl=''

Now browse to http://127.0.0.1:4000

Comment Systems
===============

Jekyll clean supports both [isso](https://posativ.org/isso) and
[disqus](https://disqus.com) comment systems.

After enabling **comments**, either **isso** or **disquss** must
be configured. Don't try configuring both!

Isso Comments
=============

Isso requires running a local server, so is not suitable for hosting
in github pages, for example. Isso is open source and keeps all your
data local, unlike Disqus (who knows exactly what they are doing with
your data).

In _config.yml you'll need to set **isso** to the fully-qualified URL
if your isso server (this is the value for **data-isso** passed to the
isso JS). Make sure **comments** is true.

Disqus Comments
===============

Expand Down
13 changes: 9 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ github: 'scotte/jekyll-clean'
# Set this to your UA-# value, or '' to disable the block completely
gaaccount: ''

# Set this to your disqus shortname to enable comments. Note that the 'comments'
# setting below must also be true. Individual posts can override 'comments' to
# disable on a post-by-post basis
disqus: ''
# The 'comments' setting enables comments. You'll need to select either
# disqus or isso below to choose a comment system. Individual posts can
# override 'comments' to disable on a post-by-post basis.
comments: true

# Set this to your public isso URL to enable comments via isso. Set to '' to disable isso.
isso: ''

# Set this to your disqus shortname to enable comments via disqus. Set to '' to disable disqus.
disqus: ''

permalink: /:year/:month/:title
paginate: 3

Expand Down
2 changes: 1 addition & 1 deletion _includes/disqus-comments.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if page.comments %}
{% if site.comments and page.comments and site.disqus != '' %}
<script type="text/javascript">
var disqus_shortname = '{{ site.disqus }}';

Expand Down
2 changes: 1 addition & 1 deletion _includes/disqus-counts.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if site.comments == true and site.disqus != '' %}
{% if site.comments and site.disqus != '' %}
<script type="text/javascript">
var disqus_shortname = '{{ site.disqus }}';

Expand Down
1 change: 1 addition & 0 deletions _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
</div>

{% include disqus-counts.html %}
{% include isso-comments.html %}
{% include analytics.html %}

</body>
Expand Down
3 changes: 3 additions & 0 deletions _includes/isso-comments.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% if site.comments and site.isso != '' %}
<script data-isso="{{ site.isso }}" src="{{ site.baseurl }}/js/embed.min.js"></script>
{% endif %}
13 changes: 10 additions & 3 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,25 @@
<div class="article">
<div class="well">
<h1><a href="{{ site.baseurl}}{{ page.url }}">{{ page.date | date: "%b %-d, %Y" }} - {{ page.title }}</a></h1>
{% if site.comments == true and page.comments == true and site.disqus != '' %}
{% if site.comments and page.comments %}
{% if site.disqus != '' %}
<p class="author"><a href="#disqus_thread" data-disqus-identifier="{{ page.url | slugify }}">Comments</a></p>
{% elsif site.isso != '' %}
<p class="author"><a href="{{ site.baseurl }}{{ page.url }}{{ site.isso_suffix }}#isso-thread">Comments</a></p>
{% endif %}
{% endif %}
<div class="post-content">
{{ content }}
</div>
{% if page.comments %}
{% if site.disqus != '' %}
<div id="disqus_thread">
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
{% elsif site.isso != '' %}
<section id="isso-thread"></section>
{% endif %}
{% endif %}
</div>
</div>
Expand All @@ -30,8 +38,7 @@ <h1><a href="{{ site.baseurl}}{{ page.url }}">{{ page.date | date: "%b %-d, %Y"
{% if page.previous %}
<a class="btn btn-default" href="{{ site.baseurl}}{{ page.previous.url }}" class="previous">Older Post</a>
{% endif %}
</div>

</div>
</div>
</div>
</div>
Expand Down
22 changes: 22 additions & 0 deletions _posts/2014-08-22-jekyll-clean-theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,28 @@ $ jekyll serve --baseurl=''

Now browse to http://127.0.0.1:4000

Comment Systems
===============

Jekyll clean supports both [isso](https://posativ.org/isso) and
[disqus](https://disqus.com) comment systems.

After enabling **comments**, either **isso** or **disquss** must
be configured. Don't try configuring both!

Isso Comments
=============

Isso requires running a local server, so is not suitable for hosting
in github pages, for example. Isso is open source and keeps all your
data local, unlike Disqus (who knows exactly what they are doing with
your data).

In _config.yml you'll need to set **isso** to the fully-qualified URL
if your isso server (this is the value for **data-isso** passed to the
isso JS). Make sure **comments** is true.


Disqus Comments
===============

Expand Down
8 changes: 6 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
<div class="article">
<div class="well">
<h1><a href="{{ site.baseurl}}{{ post.url }}">{{ post.date | date: "%b %-d, %Y" }} - {{ post.title }}</a></h1>
{% if site.comments == true and post.comments == true and site.disqus != '' %}
<p class="author"><a href="{{ site.baseurl }}{{ post.url }}/#disqus_thread">Comments</a></p>
{% if site.comments and post.comments %}
{% if site.disqus != '' %}
<p class="author"><a href="{{ site.baseurl }}{{ post.url }}/#disqus_thread" data-disqus-identifier="{{ post.url | slugify }}">Comments</a></p>
{% elsif site.isso != '' %}
<p class="author"><a href="{{ site.baseurl }}{{ post.url }}{{ site.isso_suffix }}#isso-thread">Comments</a></p>
{% endif %}
{% endif %}
<div class="content">
{{ post.content }}
Expand Down

0 comments on commit 67774ed

Please sign in to comment.