all repos — h3rald @ cc42c5ceb459bce4569251a8741109b870081858

The sources of https://h3rald.com

Added Disqus comments; updated archives.
h3rald h3rald@h3rald.com
Sun, 12 Sep 2010 19:32:24 +0200
commit

cc42c5ceb459bce4569251a8741109b870081858

parent

2a2063b8d7b85e92ea2b2f22db62bae197ab972e

A content/archives.erb

@@ -0,0 +1,38 @@

+----- +permalink: archives +filters_pre: +- erb +title: Archives +type: page +----- +<% + tags = sorted_site_tags +%> +<section> + <header> + <h1>Articles by Topic</h1> + </header> + <table id="taglist"> + <% c = 0 + tags.each do |t| + c = c+1 %> + <%= "<tr>" if c%5 == 1 %> + <td><%= tag_link_with_count(t[0], t[1]) %></td> + <%= "</tr>" if c%5 == 0 %> + <% end %></tr> + </table> +</section> +<section> + <header> + <h1>Articles by Month</h1> + </header> + <table id="timeline"> + <% c = 0 + articles_by_month.each do |m| + c = c+1 %> + <%= "<tr>" if c%5 == 1 %> + <td><%= month_link_with_count(m[0], m[1].length) %></td> + <%= "</tr>" if c%5 == 0 %> + <% end %></tr> + </table> +</section>
D content/archives.textile

@@ -1,35 +0,0 @@

------ -permalink: archives -filters_pre: -- erb -title: Archives -type: page ------ -<% - tags = sorted_site_tags -%> - <div id="search_form"></div> - <div id="search_results"></div> -<p style="margin: auto; text-align: center"> -<img src="/images/theme/heraldry/phoenix.png" /> -</p> - <h3>Articles by Topic</h3> - <table id="taglist"> - <% c = 0 - tags.each do |t| - c = c+1 %> - <%= "<tr>" if c%5 == 1 %> - <td><%= tag_link_with_count(t[0], t[1]) %></td> - <%= "</tr>" if c%5 == 0 %> - <% end %></tr> - </table> - <h3>Articles by Month</h3> - <table id="timeline"> - <% c = 0 - articles_by_month.each do |m| - c = c+1 %> - <%= "<tr>" if c%5 == 1 %> - <td><%= month_link_with_count(m[0], m[1].length) %></td> - <%= "</tr>" if c%5 == 0 %> - <% end %></tr> - </table>
M content/styles/_content.scsscontent/styles/_content.scss

@@ -91,9 +91,14 @@ #main-content > article h1,

article.page > header h1 { font-size: 2.8em; } +article.page > header h1 { + text-align: center; + margin: auto; +} #secondary-content > article h1, #main-content > section > article h1, +#body-text section header h1, #body-text h2 { font-size: 2em; }

@@ -101,21 +106,25 @@

#main-content > article h2, #secondary-content > section > article h1, article.page > header h2, +#body-text section section header h1, #body-text h3 { font-size: 1.6em; } #main-content > section > article h2, +#body-text section section section header h1, #body-text h5 { font-size: 1.3em; } #secondary-content > article h2, +#body-text section section section section header h1, #body-text h4 { font-size: 1.4em; } #secondary-content > section > article h2, +#body-text section section section section section header h1, #body-text h6 { font-size: 1.1em; }

@@ -132,7 +141,7 @@ margin-top: 2.5em;

h1, h2, h3, h4, h5, h6 { clear: both; padding-top: 1.5em; - padding-bottom: 0.1em; + margin-bottom: 0.8em; border-bottom: 1px solid $light-gray; width: 100%; }

@@ -155,7 +164,7 @@ article p {

margin: 0.6em 0; } -#body-text ul { +#body-text ul, ol { margin-left: 2em; }

@@ -185,7 +194,7 @@ font-size: 1.2em;

font-style: italic; } ol { - padding-left: 0.5em; + margin-left: 0; li { list-style-type: none; }
M content/styles/_layout.scsscontent/styles/_layout.scss

@@ -209,3 +209,15 @@ -webkit-column-gap: 20px;

column-count: 2; column-gap: 20px; } + +/* Archives */ + +#taglist, #timeline { + margin: 2em auto; + text-align: center; + td { + margin: 10px; + text-align: left; + width: 180px; + } +}
M content/styles/_vendor.scsscontent/styles/_vendor.scss

@@ -76,3 +76,8 @@ .gsc-cursor-current-page {

font-weight: bold; } + +/* Disqus */ +#disqus_thread { + margin: 0px 30px; +}
M layouts/default.erblayouts/default.erb

@@ -71,7 +71,21 @@ <% end %>

<%= yield %> </section> </article> - <% end %> + <% if @item[:type] == 'article' %> + <section id="disqus_thread"></section> + <script type="text/javascript"> + var disqus_identifier = "<% @item[:permalink]%>"; + var disqus_developer = true; + (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = 'http://h3rald.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=h3rald">comments powered by Disqus.</a></noscript> + <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a> + <% end %> + <% end %> <footer> <section class="ads"> <script type="text/javascript"><!--

@@ -103,5 +117,15 @@ <script src="/js/date.js" type="text/javascript"></script>

<script src="/js/feeds.js" type="text/javascript"></script> <script src="/js/search.js" type="text/javascript"></script> <script src="/js/init.js" type="text/javascript"></script> + <% if @item[:type] == 'article' %> + <script type="text/javascript"> +var disqus_shortname = 'h3rald'; +(function () { + var s = document.createElement('script'); s.async = true; + s.src = 'http://disqus.com/forums/h3rald/count.js'; + (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); +}()); + </script> + <% end %> </body> </html>
M lib/helpers.rblib/helpers.rb

@@ -30,7 +30,7 @@ %{#{link_for_tag(tag, '/tags/')} (#{count})}

end def sorted_site_tags - site_tags.sort{|a, b| a[1] <=> b[1]}.reverse + site_tags.sort{|a, b| a[0] <=> b[0]} end def articles_tagged_with(tag)