sijbrandij / railsgirls-nl

Rails app for the RailsGirlsNL website
http://railsgirls.nl
1 stars 17 forks source link

remove rakismet, let's start using Disqus #47

Closed hestervanwijk closed 10 years ago

sijbrandij commented 10 years ago

For easy googling: it's Disqus :smiley:

hestervanwijk commented 10 years ago

@sijbrandij Can you create the Disqus account for the website?

jacobvosmaer commented 10 years ago

It looks like we need to paste some special html/javascript code in the app to show the comments. Do you see that code anywhere in your Disqus account @sijbrandij ?

sijbrandij commented 10 years ago

Yes, I have it here:

  1. Place the following code where you'd like Disqus to load:
<div id="disqus_thread"></div>
    <script type="text/javascript">
        /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
        var disqus_shortname = 'railsgirlsnl'; // 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);
        })();
    </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>
  1. (Optional) See our JavaScript configuration variables documentation for ways to further customize the Disqus embed code.
sijbrandij commented 10 years ago

How to display comment count

  1. Place the following code before your site's closing </body> tag:
 <script type="text/javascript">
    /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
    var disqus_shortname = 'railsgirlsnl'; // required: replace example with your forum shortname

    /* * * 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>
  1. Append #disqus_thread to the href attribute in your links. This will tell Disqus which links to look up and return the comment count. For example: Link.