Reputation: 1381
I have managed to correctly set up Disqus for one of my Github pages, thanks to this helpful article.
Now I would like to ask if is there a way to add this Disqus integration to all my pages on the domain.
P.S. - I have a footer.html which is <iframe>
d in all my github pages. Is there something I can use from that to help my purpose. There are many sites that have disqus on all there pages, how can I do that ?
Upvotes: 0
Views: 373
Reputation: 817
As chaiyachaiya already mentioned, using Disqus in Jekyll is really simple. You simply put this code whereever you want the comment thread to appear:
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = '{{ site.disqus_shortname }}'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
Simply edit {{ site.disqus_shortname }}, or you can specify it in your site's _config.yml file
Upvotes: 1
Reputation: 2717
I there,
Like i said I swithed from Jekyll to Pelican. Pelican already embed all the stuff you need to integrate Disqus or google analytics in your blog. All you need is to specify your disqus domain in the pelicanconf file.
No manual work anymore! And like i said it's the same for google analytics.
The switching part for you may not be so hard. All you need is to tranfer your article i guess . There's little work to publish the pelican blog on gh-pages. (so little). I encourage you to take a look at the tool. It worth it.
Upvotes: 0
Reputation: 2717
From what I do understand, you want to add a disqus input for each article of your blog. Well, Jekyll use the liquid templating language, that allow html includes.
I defined a layout in '_layout' directory (e.g: default.html). I put a front-matter inside this file to tell Jekyll that I want to parse this file when I run 'jekyll build'.
I also create a disqus.html (in my _include directory) where i paste the disqus snippet of code they provide me with. I include this snippet in the default layout (where ever you want). {% include disqus.html %} (I do not use literal name like toto.html but rather variable. But it doesn't matter. We can do so)
And in each blog posts, in _post directory, in the front-matter I define 'layout: default'
That said, if you don't have the Jekyll documentation in mind, my exlpanation would be harsh to understand. So feel free to check my blog source... and the manual :).
Cheer
Upvotes: 1