Skip to content

Commit

Permalink
Fix disqus implementation and update gemspec
Browse files Browse the repository at this point in the history
  • Loading branch information
chesterhow committed Oct 24, 2019
1 parent 3eeb6a6 commit 08b2409
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 57 deletions.
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +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)
- [Disqus comments (can be enabled if needed)](#enabling-comments)

## Installation
There are 3 ways to install this theme
Expand Down Expand Up @@ -113,20 +113,14 @@ $ 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:
### Enabling Comments
Comments are disabled by default. To enable them, look for the following line in `_config.yml` and change `jekyll-tale` to your site's Disqus id.

```yml
disqus: your_disqus_id
disqus: jekyll-tale
```

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
Next, add `comments: true` to the YAML front matter of the posts which you would like to enable comments for.

## Contributing
Found a bug or have a suggestion? Feel free to create an issue or make a pull request!
Expand Down
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ paginate: 5

# Excludes
exclude: [ Gemfile, Gemfile.lock, tale.gemspec ]

# Disqus (Set to your disqus id)
disqus: jekyll-tale
2 changes: 0 additions & 2 deletions _data/theme.yml

This file was deleted.

30 changes: 0 additions & 30 deletions _includes/disqus_comment.html

This file was deleted.

11 changes: 11 additions & 0 deletions _includes/disqus_comments.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Start disqus -->
<script src="{{ "/assets/js/disqusLoader.js" | relative_url }}" /></script>
<div id="disqus_thread"><h3>Discussion and feedback</h3></div>
<div class="disqus"></div>
<script>
disqusLoader('.disqus', {
scriptUrl: 'https://{{ site.disqus }}.disqus.com/embed.js'
});
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<!-- End disqus -->
5 changes: 3 additions & 2 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ <h1 class="post-title">{{ page.title }}</h1>
<div class="post-line"></div>

{{ content }}

</div>

{% if page.comments %}
{% include disqus_comment.html %}
{% include disqus_comments.html %}
{% endif %}

<div class="pagination">
{% if page.next.url %}
<a href="{{ page.next.url | prepend: site.baseurl }}" class="left arrow">&#8592;</a>
Expand Down
21 changes: 10 additions & 11 deletions assets/js/disqusLoader.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tale.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |spec|
spec.name = "tale"
spec.version = "0.1.5"
spec.version = "0.1.6"
spec.authors = ["Chester How"]
spec.email = ["[email protected]"]

Expand Down

0 comments on commit 08b2409

Please sign in to comment.