<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title><%== @title ? @title : Thoth::Config.site.name %></title>

    <%= render_template :css %>

    <link rel="alternate" type="application/atom+xml"
        href="<%= R(Thoth::MainController, :atom) %>" title="Posts (Atom)" />
    <link rel="alternate" type="application/rss+xml"
        href="<%= R(Thoth::MainController, :rss) %>" title="Posts (RSS)" />
    <% if @feeds; @feeds.each do |feed| %>
      <link rel="alternate" type="<%== feed[:type] %>"
          href="<%== feed[:href] %>" title="<%== feed[:title] %>" />
    <% end; end %>

    <link rel="home" href="<%== Thoth::Config.site.url %>" />

    <% if @pager %>
      <% if @pager.prev_url %>
        <link id="prev_url" rel="prev" href="<%== @pager.prev_url %>" />
      <% end %>
      <% if @pager.next_url %>
        <link id="next_url" rel="next" href="<%== @pager.next_url %>" />
      <% end %>
    <% end %>
  </head>
  <body>
    <div id="doc">
      <%= render_template :header %>

      <div id="bd">
        <%= render_template :sidebar %>

        <div id="main">
          <%= flashbox('<div class="flash %key">%value</div>') %>
          <%= @content %>
        </div>
      </div>

      <%= render_template :footer %>
    </div>

    <%= render_template :js %>
  </body>
</html>
