summaryrefslogtreecommitdiff
path: root/source/layout.erb
blob: 36c3da9f0cb66625fcbcdec4d4de2dd13aa6cefe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!doctype html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta http-equiv='X-UA-Compatible' content='IE=edge;chrome=1' />
    <title>Blog Title<%= ' - ' + current_article.title unless current_article.nil? %></title>
    <%= feed_tag :atom, "#{blog.options.prefix.to_s}/feed.xml", title: "Atom Feed" %>
  </head>
  <body>
    
    <div id="main" role="main">
      <%= yield %>
    </div>
    
    <aside>
      <h2>Recent Articles</h2>
      <ol>
        <% blog.articles[0...10].each do |article| %>
          <li><%= link_to article.title, article %> <span><%= article.date.strftime('%b %e') %></span></li>
        <% end %>
      </ol>

      <h2>Tags</h2>
      <ol>
        <% blog.tags.each do |tag, articles| %>
          <li><%= link_to "#{tag} (#{articles.size})", tag_path(tag) %></li>
        <% end %>
      </ol>

      <h2>By Year</h2>
      <ol>
        <% blog.articles.group_by {|a| a.date.year }.each do |year, articles| %>
          <li><%= link_to "#{year} (#{articles.size})", blog_year_path(year) %></li>
        <% end %>
      </ol>
    </aside>
  </body>
</html>