Lucian Maran

home

Configurarea Disqus in Github Pages

09 Jan 2014

Disqus este una dintre cele mai cunoscute platforme de "Comments". In continuare am sa amintesc setarile facute de mine pt. a integra aceasta platforma cu blog-ul personal.

In continuare voi presupune urmatoarele:

Configurari pe site-ul Disqus.com

Configurari in blog (Jekyll)

 url: http://maran.ro

 disqus_short_name: lmaran
 disqus_show_comment_count: true
- ultima setare este optionala
- **important** este ca `disqus_short_name` sa fie identic cu identificatorul site-ului creat in Disqus
 <section id="comment">
    <div id="disqus_thread"></div>

        <script type="text/javascript">
            var disqus_shortname = 'lmaran';
            var disqus_identifier = 'http://maran.ro/2014/01/09/configurarea-disqus-in-github-pages/';
            var disqus_url = 'http://maran.ro/2014/01/09/configurarea-disqus-in-github-pages/';

            (function () { 
                var embedScript = document.createElement('script');
                embedScript.type = 'text/javascript';
                embedScript.async = true;
                embedScript.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
                (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(embedScript);

                var countScript = document.createElement('script');
                countScript.type = 'text/javascript';
                countScript.async = true;
                countScript.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
                (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(countScript);
            }());
        </script>

    <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>

 </section>
 comments: true

Rezultatul

Acelasi thread de comentarii este vizibil si atunci cand testez site-ul pe masina locala (localhost):

Observatii finale

Inspiratie: setarile Javascript de mai sus reprezinta o combinatie dintre setarile disqus originale si setarile preluate de pe blog-ul lui Phill Haack.

comments powered by Disqus