backend: use % for control flow and directives, <%= %> for interpolation

This commit is contained in:
Lucas 2023-03-19 21:59:41 +00:00
parent 4f5ce1100c
commit aaf12cb7c2
4 changed files with 11 additions and 7 deletions

View File

@ -1,4 +1,4 @@
<% if (my $pager = stash("pager")) { %>
% if (my $pager = stash("pager")) {
<footer>
<nav class="text-center">
<%= link_to "<<" => $pager->{first_page} if exists $pager->{first_page} %>
@ -8,4 +8,4 @@
<%= link_to ">>" => $pager->{last_page} if exists $pager->{last_page} %>
</nav>
</footer>
<% } %>
% }

View File

@ -21,12 +21,16 @@
% if (defined title) {
<h1><%= title %></h1>
% }
<div class="flex-i-fullsize"><%= content %></div>
<%= include '_pager' %>
<div class="flex-i-fullsize">
%= content
</div>
%= include "_pager"
</div>
</main>
<footer class="border-top">
<p class="viewport text-center text-small">Powered by <a href="https://www.openbsd.org">OpenBSD</a> and <a href="https://www.perl.org/">Perl</a>.</p>
<p class="viewport text-center text-small">
Powered by <%= link_to OpenBSD => "https://www.openbsd.org" %> and <%= link_to Perl => "https://www.perl.org/" %>.
</p>
</footer>
</body>
</html>

View File

@ -2,7 +2,7 @@
<p class="text-center">
<%= link_to $media->{download} => begin %>
<%= image $media->{download} %>
<%= image $media->{download} %>
<% end %>
</p>

View File

@ -2,6 +2,6 @@
<p class="text-center">
% for my $t (@$tags) {
<%= link_to "$t->{name} ($t->{count})" => $t->{uri} %>
<%= link_to "$t->{name} ($t->{count})" => $t->{uri} %>
% }
</p>