% layout 'default'; % title scalar @{$search_results} ? 'Search Results' : 'Search'; <% content_for open_graph => begin %> <% end %> <% content_for twitter_card => begin %> <% end %>

<%= title %>

<% if (scalar @{$search_results}) { =%>
<% for my $result (@{$search_results}) { =%>

<%= $result->{'post_date'} %> <% if ($result->{'post_type'} eq 'thread') { =%> <%= link_to "#$result->{'post_id'}", single_thread => {thread_id => $result->{'post_id'}}, (class => 'post__id') %> <% } else { =%> <%= link_to "#$result->{'post_id'}", single_remark => {remark_id => $result->{'post_id'}}, (class => 'post__id') %> <% } =%>

<% if (299 < length $result->{'post_body'}) { =%>
<%= truncate_text $result->{'post_body'} %> <%== markdown $result->{'post_body'} =%>
<% } else { =%>
<%== markdown $result->{'post_body'} =%>
<% } =%>
<% } =%> <% if ($last_page && $last_page != 1) { =%> <% } =%>
<% } =%>