all repos — h3rald @ 2a2063b8d7b85e92ea2b2f22db62bae197ab972e

The sources of https://h3rald.com

Articles now displayed properly, re-added TOC support.
h3rald h3rald@h3rald.com
Sun, 12 Sep 2010 15:11:05 +0200
commit

2a2063b8d7b85e92ea2b2f22db62bae197ab972e

parent

cbfc822521fc8eab0f42a08fae2018469a978175

M RulesRules

@@ -1,18 +1,18 @@

#!/usr/bin/env ruby -compile /^\/archives\// do +compile /^\/(archives|home)\// do rep.filter :erb layout 'default' end -compile /^\/(home|projects|about)/ do +compile /^\/(projects|about)/ do rep.filter :erb rep.filter :redcloth layout 'default' end compile /(rss|atom)/ do - rep.filter :erb unless rep.binary? + rep.filter :erb unless rep.binary? # e.g. rss.png image end compile '/styles/_*/' do
M content/home.erbcontent/home.erb

@@ -15,7 +15,8 @@ all_articles = latest_articles.length

latest = latest_articles 5 popular = popular_articles 5 all_projects = @items.select{|a| a[:type] == 'project'}.length -%><section id="topbar"> +%> +<section id="topbar"> <nav id="social"> <ul> <li><a href="http://www.h3rald.com/rss/" rel="external"><img src="/images/social/rss.png" alt="RSS" /></a></li>

@@ -29,7 +30,7 @@ </nav>

<aside id="search"> <section id="search_form"></section> </aside> -</section> +</section><!-- #topbar end --> <section id="search_results"></section> <section class="left" id="main-content"> <article id="recent-1">

@@ -45,10 +46,10 @@ <p>Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>

<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p> </section> </article> - <section class="clear-left left"> + <section class="clear-left left" id="#main-content-left"> <script src="http://widgets.twimg.com/j/2/widget.js"></script> - <section> - <script id="twitter"> + <section id="twitter"> + <script> new TWTR.Widget({ version: 2, type: 'profile',

@@ -78,7 +79,7 @@ behavior: 'all'

} }).render().setUser('h3rald').start(); </script> - </section> + </section><!-- #twitter end --> <article id="recent-4"> <header> <h1><a href="#">Glyph 0.3.0 Released</a></h1>

@@ -103,9 +104,8 @@ <p>Looking for a peaceful and relaxing holiday in the Italian Riviera? I'm renting part of my family country home in the center of the old village of Sessarego, on a peaceful hill a few minutes away from Bogliasco, a small coastal town on the Golfo Paradiso. </p>

<p>The center of Genoa can be reached by car, bus or train in about 30 minutes and a lot of tourist locations like Camogli, Rapallo, Santa Margherita and Portofino are just a few train stops away.</p> </section> </article> - - </section> - <section class="right border-left"> + </section><!-- #main-content-left end --> + <section class="right border-left" id="main-content-right"> <article id="recent-2"> <header> <h1><a href="#">Glyph 0.4.0 Released</a></h1>

@@ -142,8 +142,8 @@ <section>

<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> </section> </article> - </section> -</section> + </section><!-- #main-content-right end --> +</section><!-- #main-content end --> <section class="right" id="secondary-content"> <article id="popular-1"> <header>

@@ -171,7 +171,7 @@ <p>With Glyph, creating and maintaining any kind of document becomes as easy as... programming. </p>

<p>Glyph enables you to minimize text duplication, focus on content rather than presentation, manage references seamlessly and automate tedious tasks through a simple but effective macro language, specifically geared towards customization and extensibility.</p> </section> </article> - <section class="left border-right"> + <section class="left border-right" id="secondary-content-left"> <article id="popular-2"> <header> <h1><a href="#">Herald (Vim Color Scheme)</a></h1>

@@ -184,8 +184,8 @@ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>

<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p> </section> </article> - </section> - <section class="right"> + </section><!-- #secondary-content-left end --> + <section class="right" id="secondary-content-right"> <article class="right popular3"> <header> <h1><a href="#">A closer look at Komodo Edit</a></h1>

@@ -198,5 +198,5 @@ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>

<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p> </section> </article> - </section> -</section> + </section><!-- #secondary-content-right end --> +</section><!-- #secondary-content-end -->
M content/js/init.jscontent/js/init.js

@@ -20,7 +20,7 @@ $('header.home > time').attr('datetime', Date.today().toString("yyyy-MM-dd"));

///////////////////////// $('.timeago').timeago(); // TOC - $("#toc ol").tableOfContents("#content-body", {startLevel: 3, depth: 6, topLinks: "[top]"}); + $("#auto-toc ol").tableOfContents("#body-text", {startLevel: 1, depth: 6, topLinks: "&uarr;"}); // Drop Caps /* var first_paragraph = $('#content-body p:first');
M content/styles/_content.scsscontent/styles/_content.scss

@@ -87,36 +87,76 @@

/* Headers */ -#main-content > article h1, article.page > header h1 { +#main-content > article h1, +article.page > header h1 { font-size: 2.8em; } -#secondary-content > article h1, #main-content > section > article h1 { + +#secondary-content > article h1, +#main-content > section > article h1, +#body-text h2 { font-size: 2em; } -#main-content > article h2, #secondary-content > section > article h1, article.page > header h2 { + +#main-content > article h2, +#secondary-content > section > article h1, +article.page > header h2, +#body-text h3 { font-size: 1.6em; } -#main-content > section > article h2 { + +#main-content > section > article h2, +#body-text h5 { font-size: 1.3em; } -#secondary-content > article h2 { + +#secondary-content > article h2, +#body-text h4 { font-size: 1.4em; } -#secondary-content > section > article h2 { + +#secondary-content > section > article h2, +#body-text h6 { font-size: 1.1em; } +/* Text */ + article { - p { font-size: 93%; } + font-size: 93%; header > p { font-size: 90%; } } -/* Text */ - - +#body-text { + margin-top: 2.5em; + h1, h2, h3, h4, h5, h6 { + clear: both; + padding-top: 1.5em; + padding-bottom: 0.1em; + border-bottom: 1px solid $light-gray; + width: 100%; + } + img { + margin: 1em; + } + .right, img[style="float:right;"] { + margin: 1em 0 1em 1em; + } + .left, img[style="float:left;"] { + margin: 1em 1em 1em 0; + } + blockquote { + font-style: italic; + color: #8F6B17; + } +} article p { margin: 0.6em 0; +} + +#body-text ul { + margin-left: 2em; } article.feature {

@@ -136,6 +176,30 @@ margin-bottom:10px;

} } +/* TOC */ + +#auto-toc { + #toc-title { + border-bottom: none; + font-size: 1.2em; + font-style: italic; + } + ol { + padding-left: 0.5em; + li { + list-style-type: none; + } + } + float: right; + margin: 1em 0 1.5em 1.5em; + padding: 0.5em; + border: 1px solid $light-gray; +} + +.toc-top-link { + font-size: 0.5em; + font-weight: normal; +} /* Classes */
M layouts/default.erblayouts/default.erb

@@ -4,7 +4,6 @@ -----

<!DOCTYPE html> <html lang="en"> <head> - <title>H3RALD</title> <title><%= @item[:title] %> - H3RALD</title> <% if @item[:feed_url] then %> <link rel="alternate" type="application/rss+xml" title="H3RALD - <%= @item[:feed_title]%>" href="<%= @item[:feed_url]%>" />

@@ -14,6 +13,7 @@ <link rel="alternate" type="application/rss+xml" title="H3RALD - <%= @item[:feed_title]%>" href="<%= @item[:feed]%>rss/" />

<link rel="alternate" type="application/atom+xml" title="H3RALD - <%= @item[:feed_title]%>" href="<%= @item[:feed]%>atom/" /> <% end %> <% end %> + <meta charset="utf-8" /> <meta name="author" content="Fabio Cevasco" /> <meta name="copyright" content="Fabio Cevasco" /> <meta name="robots" content="all, follow" />

@@ -36,7 +36,6 @@ end

%> <meta name="keywords" content="<%= keywords %>" /> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> - <meta charset="utf-8" /> <meta content="44.388041;9.073248" name="ICBM" />

@@ -56,21 +55,23 @@ <![endif]-->

<section id="container"> <% if @item[:permalink] == 'home' then %> - <%= render 'home_header' %> + <%= render 'home_header' %> + <%= yield %> <% else %> - <%= render 'page_header', :item => @item %> - <% end %> - <% if @item[:permalink] == 'home' then%> - <%= yield %> - <% else %> - <article class="page"> - <%= render 'page_meta', :item => @item %> - <section> - <%= yield %> - </section> - </article> + <%= render 'page_header', :item => @item %> + <article class="page"> + <%= render 'page_meta', :item => @item %> + <section id="body-text"> + <% if @item[:toc] then %> + <aside id="auto-toc"> + <span id="toc-title">Table of Contents</span> + <ol></ol> + </aside> + <% end %> + <%= yield %> + </section> + </article> <% end %> - <!-- TODO from here --> <footer> <section class="ads"> <script type="text/javascript"><!--

@@ -91,7 +92,7 @@ </nav>

<p>&copy; 2010 &mdash; <em>Fabio Cevasco</em></p> </section> </footer> - </section> + </section><!-- #container end --> <script src="http://www.google.com/jsapi?key=ABQIAAAA6h3j8Jri5D_da53UPbEbThRlq2n1sm52B5HDRR5tm6o8XM18FhTKn3v155RpPeD0kWnWG81QEhhifQ" type="text/javascript"></script> <script src="/js/jquery.js" type="text/javascript"></script> <script src="/js/jquery-timeago.js" type="text/javascript"></script>
M layouts/home_header.erblayouts/home_header.erb

@@ -7,7 +7,7 @@ ['review', 'ruby', 'opensource', 'productivity', 'writing', 'software'].map{|l| %{<a href="/tags/#{l}/" rel="tag">#{l.upcase}</a>} }.join("|") +

%{|<a href="/archives/" rel="archives"><strong>MORE</strong>&nbsp;&raquo;</a> } %> </nav> <header class="home"> -<nav class="left"> + <nav class="left"> <script type="text/javascript"><!-- google_ad_client = "pub-2871497824158668"; /* 234x60, created 9/5/10 */

@@ -22,9 +22,9 @@ </nav>

<h1> <a href="/"> <img src="/images/h3rald.png" alt="H3RALD" class="default"/> - <!--[if !IE]> + <![if !IE]> <img src="/images/h3rald_hover.png" alt="H3RALD" class="hover"/> - <![endif]--> + <![endif]> </a> </h1> <nav class="right">

@@ -36,7 +36,7 @@ google_ad_width = 234;

google_ad_height = 60; //--> </script> - <script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> + <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </nav> <time></time>
M layouts/page_header.erblayouts/page_header.erb

@@ -11,6 +11,8 @@ when !@item[:tags].blank? then

link = link_for_tag @item[:tags][0].upcase, "/tags/" when @item[:type] == 'project' then link = %{<a href="/projects/" rel="archives">PROJECTS</a>} +else + link = %{<a href="/archives/" rel="archives">ARCHIVES</a>} end %><header class="page"> <nav class="home-link">