Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add Disqus comment threads on recipe pages.

  • Loading branch information...
commit fce8abfa54be2a7707f6063b51d66098ebbdcc31 1 parent f8e8525
runpaint runpaint authored
Showing with 30 additions and 0 deletions.
  1. +1 −0  TODO
  2. +24 −0 templates/recipe.html
  3. +5 −0 templates/web.css
1  TODO
View
@@ -54,3 +54,4 @@ Web Version
* Add CC license fragment to recipe template.
* Link PDF from recipes?
* Gzip HTML.
+* Generate DevHelp version.
24 templates/recipe.html
View
@@ -17,12 +17,36 @@
<p><a href="/toc/">Vim Recipes</a> <span>&#8227;</span> <a href="/<%= section_id %>/"><%= section %></a> <span>&#8227;</span>
<i><%= title %></i></p>
<%= body %>
+ <div style="clear:both" id="disqus_thread"></div>
+ <script type="text/javascript"
+ src="http://disqus.com/forums/vimrecipes/embed.js">
+ </script>
+ <noscript>
+ <a href="http://vimrecipes.disqus.com/?url=ref">View the comment thread.</a>
+ </noscript>
<div id="footnotes"></div>
<div class="nav"><a
rel="prev" href="/<%= prev_e[:section_id] %>/<%= prev_e[:id]
%>/">&#x21A9; &nbsp; <%=
prev_e[:title] %></a> <a rel="next" href="/<%= next_e[:section_id] %>/<%= next_e[:id] %>/"><%=
next_e[:title] %> &nbsp; &#x21AA;</a></div>
+
+
+ <script type="text/javascript">
+ //<![CDATA[
+ (function() {
+ var links = document.getElementsByTagName('a');
+ var query = '?';
+ for(var i = 0; i < links.length; i++) {
+ if(links[i].href.indexOf('#disqus_thread') >= 0) {
+ query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
+ }
+ }
+ document.write('<script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/vimrecipes/get_num_replies.js' + query + '"></' + 'script>');
+ })();
+ //]]>
+ </script>
+
<script type="text/javascript" src="/js/footnotes.js"></script>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl."
5 templates/web.css
View
@@ -63,3 +63,8 @@ span.fn a:link {
.nav a:last-child{float:right}
/*.nav span{font-size:1000%;line-height:1;margin:0;text-shadow:gainsboro 3px 3px 3px} */
p {margin: 1em 0}
+#disqus_thread {
+ border-top: 1px solid #ccc;
+ margin: 20px 0 20px 0;
+ padding: 10px 0 0 0;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.