Added article metadata; renamed layouts. * Closes #35.
h3rald h3rald@h3rald.com
Wed, 02 Sep 2009 11:49:29 +0200
11 files changed,
31 insertions(+),
2 deletions(-)
A
layouts/article_meta.erb
@@ -0,0 +1,7 @@
+----- +filter: erb +----- +<ul class="article-meta"> + <li>Composed on <span class="date"><%= @article.attributes[:date].strftime("%A, %d %B %Y") %></span></li> + <li>Archived as <%= tags_for(@article) %></li> +</ul>
M
layouts/dated_article.htm
→
layouts/dated_article.erb
@@ -1,4 +1,4 @@
----- filter: erb ----- -<li><a href="/articles/<%= @article.attributes[:permalink]%>/"><%= @article.attributes[:title]%></a> (<span class="timeago" title="<%=@article.attributes[:date].to_iso8601_time%>"><%= @article.attributes[:date].strftime("%A, %d %B %Y – %H:%M")%></span>)</li> +<li><a href="/articles/<%= @article.attributes[:permalink]%>/"><%= @article.attributes[:title]%></a> (<span class="timeago" title="<%=@article.attributes[:date].to_iso8601_time%>"><%= @article.attributes[:date].strftime("%A, %d %B %Y")%></span>)</li>
M
layouts/default.htm
→
layouts/default.erb
@@ -63,6 +63,10 @@ <div id="container">
<!-- CONTENT START --> <div id="content" class="clearfix<%= (@item[:permalink] == 'home') ? ' home' : ' standard' %>"> <h2><%= @item[:title] %></h2> + <% case @item[:type] + when 'article' then%> + <%= render 'article_meta', :article => @item %> + <% end %> <%= yield %> </div> <!-- CONTENT END -->
M
lib/helpers.rb
→
lib/helpers.rb
@@ -17,6 +17,10 @@ end
ts end + def tags_for(article) + article.attributes[:tags].map{|t| %{<a class="tag" href="/tags/#{t}/">#{t}</a>}}.join " · " + end + def tag_link_with_count(tag, count) %{#{link_for_tag(tag, '/tags/')} (#{count})} end
M
resources/css/elements.css
→
resources/css/elements.css
@@ -108,7 +108,6 @@ .tag
{ font-weight: bold; font-style: italic; - font-size: 0.95em; } .project-data@@ -122,6 +121,21 @@
ul { overflow: hidden; +} + +ul.article-meta +{ + list-style-type: none; +} + +.date +{ + font-style: italic; +} + +#content .article-meta li +{ + margin-left: 0; } /** Share buttons **/