1
0
Fork 0
forked from wezm/wezm.net

Add more headers, feed icon, date helpers

This commit is contained in:
Wesley Moore 2009-11-22 18:02:22 +11:00
parent 99fbc65ce8
commit cebe17fde4
6 changed files with 43 additions and 5 deletions

View file

@ -11,7 +11,7 @@
<body>
<%= render 'header' %>
<div id="main">
<h1><%= @item[:title] %></h1>
<h1><a href="<%= @item.reps.first.path %>"><%= @item[:title] %></a></h1>
<%= yield %>
</div>
<%= render 'footer' %>

View file

@ -1,11 +1,13 @@
<div id="header">
<a href="/">WezM<sup>.net</sup></a>
<ul id="menu">
<li><a href="/articles/">Articles</a></li>
<li><a href="/topics/">Topics</a></li>
<li><a href="/about/">About</a></li>
<li><a href="mailto:contact@example.com">Contact Me</a></li>
<li><a href="mailto:contact@example.com">Contact</a></li>
<li>
<a href="<%= feed_url %>"><img src="/images/feed-icon-14x14.png" width="14" height="14" /></a>
<a href="<%= feed_url %>">RSS</a>
<a href="<%= feed_url %>">Feed</a>
</li>
</ul>
</div>

View file

@ -11,9 +11,25 @@
<body>
<%= render 'header' %>
<div id="main">
<ul class="articles">
<% sorted_articles[0..9].each do |article| %>
<h1><a href="<%= article.reps.first.path %>"><%= article[:title] %></a></h1>
<% post_date = WezM::Helpers.post_date(article) %>
<li>
<abbr class="calender date" title="<%= post_date.iso8601 %>">
<span class="day"><%= post_date.day %></span>
<span class="month"><%= post_date.strftime('%b') %></span>
<span class="year"><%= post_date.year %></span>
</span>
<a href="<%= article.reps.first.path %>"><%= article[:title] %></a>
</li>
<% end %>
</ul>
<div class="pagination">
<a href="">&laquo; Newer</a>
|
<a href="">Older &raquo;</a>
</div>
</div>
<%= render 'footer' %>
</body>

11
lib/helpers.rb Normal file
View file

@ -0,0 +1,11 @@
require 'time'
module WezM
module Helpers
def self.post_date(article)
Time.parse(article[:created_at])
end
end
end

View file

@ -12,7 +12,7 @@ body {
}
p,li {
font-size: 1.4em;
font-size: 1.6em;
line-height: 1.2;
}
@ -72,6 +72,15 @@ a:hover {
/* color: #f90;*/
}
h1 a {
text-decoration: none;
}
h1 a:link,
h1 a:visited {
color: #111;
}
sup {
vertical-align: super;
font-size: 0.8em;

BIN
output/images/feed-icon-14x14.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 B