<main>
    <header>
        <h1><%= $self->title %></h1>

        <p class="tags">Tags:
        % for my $link ( $self->tags ) {
            <a href="<%= $link->href %>" rel="tag"><%= $link->text %></a>
        % }
        </p>

        <aside>
            <p><time datetime="<%= $self->date->strftime('%Y-%m-%d') %>">
                Posted on <%= $self->date->strftime('%Y-%m-%d') %>
            </time>
            % if ( $self->author ) {
            by <span class="author"><%= $self->author %></span>
            % }
            </p>
        </aside>

        % if ( $self->links( 'alternate' ) ) {
        <div class="alert alert-info alternate">
            <p>Originally posted as:</p>
            <ul>
            % for my $link ( $self->links( 'alternate' ) ) {
                <li><a class="alert-link" href="<%= $link->href %>">
                    <em><%= $self->title %></em> on <%= $link->title %>.
                </a></li>
            % }
            </ul>
        </div>
        % }

    </header>

    % my @sections = $self->sections;
    % for my $i ( 0..$#sections ) {
    <section id="section-<%= $i+1 %>">
        <%= $sections[$i] %>
    </section>
    % }

</main>

<nav id="tags">
    <h1>Tags</h1>
    <ul class="list-inline">
    % for my $link ( $app->tags ) {
        <li><a href="<%= $link->href %>"><%= $link->text %></a></li>
    % }
    </ul>
</nav>
