commit 29872d04f52fb3ff740cb4070397defdcb98eaa7
parent bf747fa3a11fa838e7c7c45ed022c4673d059493
Author: Hugo Soucy <hugo@soucy.cc>
Date: Mon, 14 Nov 2022 19:32:14 -0500
Modify templates
Diffstat:
5 files changed, 25 insertions(+), 20 deletions(-)
diff --git a/templates/default.html b/templates/default.html
@@ -2,13 +2,16 @@
<%- content %>
<% if collection then %>
+ <hr/>
<aside>
- <p>
- <a
- href="<%= collection[1].rellink %>">
- <%- collection[1].title -%>
- </a>
- </p>
+ <ol>
+ <% for _, child in ipairs(collection) do %>
+ <li>
+ <a href="<%= child.rellink -%>"><%= child.title -%></a> —
+ <time datetime="<%= child.date -%>T<%= child.datetime -%>"><%= child.date -%></time>
+ </li>
+ <% end %>
+ </ol>
</aside>
<% end %>
diff --git a/templates/feed.xml.html b/templates/feed.xml.html
@@ -15,6 +15,7 @@
<uri><%- author.uri -%></uri>
</author>
+ <!-- ATOM entries should be sort by the updated field -->
<% if children then %>
<% for i = 1, #children do %>
<entry>
diff --git a/templates/index.html b/templates/index.html
@@ -3,12 +3,14 @@
media="screen"
rel="stylesheet"/>
<%- content -%>
-<aside class="main__aside">
- <small>Dernière publication</small>
- <p>
- <a
- href="<%= collection[1].rellink %>">
- <%- collection[1].title -%>
- </a>
- </p>
-</aside>
+<% if #collection >= 1 then %>
+ <aside class="main__aside">
+ <small>Dernière publication</small>
+ <p>
+ <a
+ href="<%= collection[1].rellink %>">
+ <%- collection[1].title -%>
+ </a>
+ </p>
+ </aside>
+<% end %>
diff --git a/templates/publications.html b/templates/publications.html
@@ -58,17 +58,15 @@
<h2 class="p-name">
<a class="u-url" href="<%= children[i].rellink -%>" rel="bookmark"><%= children[i].title -%></a>
</h2>
-
- <% if children[i].summary then %>
- <p class="p-content"><%- children[i].summary -%></p>
- <% end %>
<% else %>
<h2 class="visuallyhidden">
<%= children[i].title -%>
</h2>
<% end %>
- <% if not children[i].summary then %>
+ <% if children[i].summary then %>
+ <p class="p-content"><%- children[i].summary -%></p>
+ <% else %>
<div class="e-content<% if children[i].posttype == 'note' then %> p-name<% end %>"><%- children[i].content -%></div>
<% end %>
diff --git a/templates/sitemap.xml.html b/templates/sitemap.xml.html
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<% if sitemap then %>
+ <!-- SITEMAPXML entries should be sort by the lastmod field -->
<% for i = 1, #sitemap do %>
<url>
<loc><%= sitemap[i].permalink -%></loc>