Permalink
Browse files

Add option to use Disqus comments

Configure with disqus_shortname environment
variable
  • Loading branch information...
1 parent 239bc38 commit 982b8f149ac4b09ee107c2611452ece2067ac6c9 Daniel Whalen committed Jun 23, 2012
@@ -228,8 +228,13 @@ code {
color: #fff;
}
-.button.space-top {
- margin-top: 100px;
+.button {
+ &.space-top {
+ margin-top: 50px;
+ }
+ &.space-bottom {
+ margin-bottom: 50px;
+ }
}
.left {
@@ -0,0 +1,16 @@
+<% if CONFIG['disqus_shortname'].present? %>
+<div id="disqus_thread"></div>
+<script type="text/javascript">
+ /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
+ var disqus_shortname = '<%= CONFIG['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 = 'http://' + 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>
+<% end %>
@@ -21,7 +21,9 @@
<li><%= link_to 'Edit', '/edit/' + post.id.to_s unless @preview %></li>
</ul>
<%- end -%>
+ <% if @single_post %>
+ <a class="button space-top space-bottom" href="<%= root_url %>">Back to Blog</a>
+ <%= render 'posts/comments' %>
+ <% end %>
</div>
-
- <% if @single_post %><a class="button space-top" href="<%= root_url %>">Back to Blog</a><% end %>
</section>
View
@@ -7,4 +7,5 @@ name: Your name
twitter: your_twitter_handle
github: your_github_handle
email: address@example.com
-google_analytics_id: YOUR_GA_ID
+google_analytics_id: YOUR_GA_ID
+disqus_shortname: <%= ENV.fetch("disqus_shortname") { "" } %>

0 comments on commit 982b8f1

Please sign in to comment.