Fix disqus implementation and update gemspec
This commit is contained in:
parent
3eeb6a6dff
commit
08b2409165
8 changed files with 33 additions and 57 deletions
16
README.md
16
README.md
|
@ -13,7 +13,7 @@ Tale is a minimal Jekyll theme curated for storytellers. Checkout the demo [here
|
||||||
- Syntax highlighting, with the help of Pygments
|
- Syntax highlighting, with the help of Pygments
|
||||||
- Markdown and HTML text formatting
|
- Markdown and HTML text formatting
|
||||||
- Pagination of posts
|
- Pagination of posts
|
||||||
- [Enabling Comments (via Disqus)](#enabling-comments-via-disqus)
|
- [Disqus comments (can be enabled if needed)](#enabling-comments)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
There are 3 ways to install this theme
|
There are 3 ways to install this theme
|
||||||
|
@ -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.
|
And you're all set! Head over to http://127.0.0.1:4000/ to see your site in action.
|
||||||
|
|
||||||
|
### Enabling Comments
|
||||||
### Enabling Comments (via Disqus)
|
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.
|
||||||
|
|
||||||
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
|
```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).
|
Next, add `comments: true` to the YAML front matter of the posts which you would like to enable comments for.
|
||||||
|
|
||||||
Comments are disabled by default and will only appear in when adding `comments: true` to that post's YAML Front Matter
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
Found a bug or have a suggestion? Feel free to create an issue or make a pull request!
|
Found a bug or have a suggestion? Feel free to create an issue or make a pull request!
|
||||||
|
|
|
@ -36,3 +36,6 @@ paginate: 5
|
||||||
|
|
||||||
# Excludes
|
# Excludes
|
||||||
exclude: [ Gemfile, Gemfile.lock, tale.gemspec ]
|
exclude: [ Gemfile, Gemfile.lock, tale.gemspec ]
|
||||||
|
|
||||||
|
# Disqus (Set to your disqus id)
|
||||||
|
disqus: jekyll-tale
|
|
@ -1,2 +0,0 @@
|
||||||
# Disqus
|
|
||||||
disqus: your_disqus_id
|
|
|
@ -1,30 +0,0 @@
|
||||||
<!-- 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>
|
|
||||||
<div class="disqus-loading"><!-- Please wait, loading comments… --></div>
|
|
||||||
<style>
|
|
||||||
.disqus-placeholder.is-hidden { display: none; }
|
|
||||||
</style>
|
|
||||||
<script>
|
|
||||||
disqusLoader( '.disqus',
|
|
||||||
{
|
|
||||||
scriptUrl: 'https://{{ site.data.theme.disqus }}.disqus.com/embed.js',
|
|
||||||
disqusConfig: function()
|
|
||||||
{
|
|
||||||
this.page.identifier = '{{ page.id }}';
|
|
||||||
this.page.url = '{{ site.baseurl }}/{{ post.url }}';
|
|
||||||
this.page.title = '{{page.title}}';
|
|
||||||
this.callbacks.onReady = [function()
|
|
||||||
{
|
|
||||||
var el = document.querySelector( '.disqus-loading' );
|
|
||||||
if( el.classList )
|
|
||||||
el.classList.add( 'is-hidden' );
|
|
||||||
else
|
|
||||||
el.className += ' ' + 'is-hidden';
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
|
||||||
<!-- End disqus -->
|
|
11
_includes/disqus_comments.html
Normal file
11
_includes/disqus_comments.html
Normal file
|
@ -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 -->
|
|
@ -21,11 +21,12 @@ layout: default
|
||||||
<div class="post-line"></div>
|
<div class="post-line"></div>
|
||||||
|
|
||||||
{{ content }}
|
{{ content }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if page.comments %}
|
{% if page.comments %}
|
||||||
{% include disqus_comment.html %}
|
{% include disqus_comments.html %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
{% if page.next.url %}
|
{% if page.next.url %}
|
||||||
<a href="{{ page.next.url | prepend: site.baseurl }}" class="left arrow">←</a>
|
<a href="{{ page.next.url | prepend: site.baseurl }}" class="left arrow">←</a>
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
disqusLoader.js v1.0
|
disqusLoader.js v1.0
|
||||||
A JavaScript plugin for lazy-loading Disqus comments widget.
|
A JavaScript plugin for lazy-loading Disqus comments widget.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Gem::Specification.new do |spec|
|
Gem::Specification.new do |spec|
|
||||||
spec.name = "tale"
|
spec.name = "tale"
|
||||||
spec.version = "0.1.5"
|
spec.version = "0.1.6"
|
||||||
spec.authors = ["Chester How"]
|
spec.authors = ["Chester How"]
|
||||||
spec.email = ["chesterhow@gmail.com"]
|
spec.email = ["chesterhow@gmail.com"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue