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

View file

@ -1,11 +1,13 @@
<div id="header"> <div id="header">
<a href="/">WezM<sup>.net</sup></a> <a href="/">WezM<sup>.net</sup></a>
<ul id="menu"> <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="/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> <li>
<a href="<%= feed_url %>"><img src="/images/feed-icon-14x14.png" width="14" height="14" /></a> <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> </li>
</ul> </ul>
</div> </div>

View file

@ -11,9 +11,25 @@
<body> <body>
<%= render 'header' %> <%= render 'header' %>
<div id="main"> <div id="main">
<ul class="articles">
<% sorted_articles[0..9].each do |article| %> <% 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 %> <% end %>
</ul>
<div class="pagination">
<a href="">&laquo; Newer</a>
|
<a href="">Older &raquo;</a>
</div>
</div> </div>
<%= render 'footer' %> <%= render 'footer' %>
</body> </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 { p,li {
font-size: 1.4em; font-size: 1.6em;
line-height: 1.2; line-height: 1.2;
} }
@ -72,6 +72,15 @@ a:hover {
/* color: #f90;*/ /* color: #f90;*/
} }
h1 a {
text-decoration: none;
}
h1 a:link,
h1 a:visited {
color: #111;
}
sup { sup {
vertical-align: super; vertical-align: super;
font-size: 0.8em; font-size: 0.8em;

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 B