all repos — h3rald @ 9b8ca2f062d812cd95cef44c360afadfcb83b4da

The sources of https://h3rald.com

Added article metadata; renamed layouts.
* Closes #35.
h3rald h3rald@h3rald.com
Wed, 02 Sep 2009 11:49:29 +0200
commit

9b8ca2f062d812cd95cef44c360afadfcb83b4da

parent

54c9f66700484db5c7fc30b47cd5e812915b10b4

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.htmlayouts/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 &ndash; %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.htmlayouts/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.rblib/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 " &middot; " + end + def tag_link_with_count(tag, count) %{#{link_for_tag(tag, '/tags/')} (#{count})} end
M resources/css/elements.cssresources/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 **/