% layout 'default';
% title my $remark_id = $remark->{'id'} ? "Remark #$remark_id" : '?';
<h2 class="page-title">
  <%= title %> <sup><%= link_to txt => url_for . '.txt' %></sup>
</h2>
<% if (keys %{$remark}) { =%>
<% content_for open_graph => begin %>
  <meta property="og:type" content="article">
  <meta property="og:title"
        content="Thread #<%= $remark->{'thread_id'} %>, <%= title %>">
  <meta property="og:description"
        content="<%= truncate_text $remark->{'body'} %>">
<% end %>
<% content_for twitter_card => begin %>
  <meta name="twitter:title"
        content="Thread #<%= $remark->{'thread_id'} %>, <%= title %>">
  <meta name="twitter:description"
        content="<%= truncate_text $remark->{'body'} %>">
<% end %>
<main class="pager">
  <article class="post">
    <h4 class="post__title">
      <%= $remark->{'date'} %>
      <span class="post__id">#<%= $remark->{'id'} %></span>
    </h4>
    <h5 class="post__author"><%= $remark->{'author'} %></h5>
    <div class="post__body">
      <%== markdown $remark->{'body'} =%>
    </div>
    <nav class="post__nav">
      <%= link_to Thread => single_thread =>
          {thread_id => $remark->{'thread_id'}}, (class => 'click') %>
      <%= link_to Remark => post_remark =>
          {thread_id => $remark->{'thread_id'}, remark_id => $remark->{'id'}},
          (class => 'click') %>
      <%= link_to Flag => flag_remark => {remark_id => $remark->{'id'}},
          (class => 'click') %>
    </nav>
  </article>
</main>
<% } =%>
