From 0dff2a250cfe3f17dcb7a4bbc9001e009502b1c3 Mon Sep 17 00:00:00 2001
From: Adrian Hedqvist <adrian@tollyx.net>
Date: Thu, 20 Mar 2025 22:57:40 +0100
Subject: [PATCH] more tweaks

---
 src/handlers/tags.rs           |  1 +
 static/site.css                |  1 +
 templates/atom.xml             | 15 ++++++++++++++-
 templates/page.html            | 24 +++++++++++++++---------
 templates/partials/head.html   |  6 +++---
 templates/partials/header.html |  1 +
 templates/section_index.html   |  2 +-
 7 files changed, 36 insertions(+), 14 deletions(-)

diff --git a/src/handlers/tags.rs b/src/handlers/tags.rs
index da0beec..23871ba 100644
--- a/src/handlers/tags.rs
+++ b/src/handlers/tags.rs
@@ -79,6 +79,7 @@ pub async fn view(
 
     let mut c = tera::Context::new();
     c.insert("base_url", &state.base_url.to_string());
+    c.insert("site_title", &state.settings.title);
     c.insert("tag_slug", &tag);
     c.insert("page", &ctx);
     c.insert("posts", &posts);
diff --git a/static/site.css b/static/site.css
index eb960c1..ce2b04f 100644
--- a/static/site.css
+++ b/static/site.css
@@ -22,6 +22,7 @@ img {
 pre {
     padding: 1rem;
     border-radius: 0.5em;
+    font-size: 1.2em;
 }
 
 .avatar {
diff --git a/templates/atom.xml b/templates/atom.xml
index f77839c..50d96b0 100644
--- a/templates/atom.xml
+++ b/templates/atom.xml
@@ -3,8 +3,21 @@
     <title>{{ site_title }}
     {%- if tag %} - #{{ tag.slug }}{% endif -%}
     </title>
+    <link href="{{ base_url | safe }}" type="text/html" />
     <link href="{{ feed_url | safe }}" rel="self" type="application/atom+xml"/>
-    <generator uri="{{ base_url | safe }}">tlxite</generator>
+    {%- if first_url %}
+    <link href="{{ first_url | safe }}" rel="first" />
+    {%- endif %}
+    {%- if last_url %}
+    <link href="{{ last_url | safe }}" rel="last" />
+    {%- endif %}
+    {%- if next_url %}
+    <link href="{{ next_url | safe }}" rel="next" />
+    {%- endif %}
+    {%- if previous_url %}
+    <link href="{{ previous_url | safe }}" rel="previous" />
+    {%- endif %}
+    <generator uri="{{ base_url | safe }}">tlxsite</generator>
     <updated>{{ last_updated | date(format="%+") }}</updated>
     <id>{{ feed_url | safe }}</id>
     {%- for post in posts %}
diff --git a/templates/page.html b/templates/page.html
index 8b8ad06..78e5c5c 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -1,20 +1,25 @@
 {% extends "base.html" %}
 
 {% block main -%}
-    <article>
+<article>
+    <header>
         {% if page.title -%}
-            <h1>{{ page.title }}</h1>
+        <h1>{{ page.title }}</h1>
         {% endif -%}
         {% if page.date -%}
-            <small>
-                {%- if page.draft %}Draft {% endif -%}
-                Published <time datetime="{{ page.date }}">{{ page.date | date(format="%F %R%:::z") }}</time>
+        <small>
+            {%- if page.draft %}Draft {% endif -%}
+            Published <time datetime="{{ page.date }}">{{ page.date | date(format="%F %R%:::z") }}</time>
             {%- if page.updated -%}
-                , Updated <time datetime="{{ page.updated }}">{{ page.updated | date(format="%F %R%:::z") }}</time>
+            , Updated <time datetime="{{ page.updated }}">{{ page.updated | date(format="%F %R%:::z") }}</time>
             {%- endif -%}
-            </small>
+        </small>
         {%- endif %}
+    </header>
+    <main>
         {{ page.content | safe }}
+    </main>
+    <footer>
         {% if page.tags -%}
         <small>
             <ul class="tags">
@@ -22,5 +27,6 @@
             </ul>
         </small>
         {%- endif %}
-    </article>
-{% endblock main -%}
+    </footer>
+</article>
+{% endblock main -%}
\ No newline at end of file
diff --git a/templates/partials/head.html b/templates/partials/head.html
index d942433..edd5c42 100644
--- a/templates/partials/head.html
+++ b/templates/partials/head.html
@@ -3,10 +3,10 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta name="color-scheme" content="light dark">
-    <link rel="alternate" type="application/rss+xml" href="{{base_url | safe}}atom.xml" title="{{ site_title }}">
+    <link rel="alternate" type="application/atom+xml" href="{{base_url | safe}}atom.xml" title="Sitewide feed">
     {% if tag_slug -%}
-    <link rel="alternate" type="application/rss+xml" href="{{base_url | safe}}tags/{{ tag_slug }}/atom.xml"
-        title="{{ site_title }}: Posts tagged #{{ tag_slug }}">
+    <link rel="alternate" type="application/atom+xml" href="{{base_url | safe}}tags/{{ tag_slug }}/atom.xml"
+        title="Posts tagged #{{ tag_slug }}">
     {%- endif %}
     <link rel="stylesheet" href="{{base_url | safe}}static/site.css">
     <link rel="icon" type="image/png" href="{{base_url | safe}}static/avatar.png" />
diff --git a/templates/partials/header.html b/templates/partials/header.html
index d44f66f..53e8cba 100644
--- a/templates/partials/header.html
+++ b/templates/partials/header.html
@@ -3,4 +3,5 @@
         <a href="{{base_url | safe}}"><img src="{{base_url | safe}}static/avatar.png" class="avatar" /></a>
         <b><a href="{{base_url | safe}}">{{ site_title }}</a></b> - <a href="{{base_url | safe}}posts/">posts</a>
     </nav>
+    <hr style="border-style: dashed;">
 </header>
\ No newline at end of file
diff --git a/templates/section_index.html b/templates/section_index.html
index 677e673..06f45ea 100644
--- a/templates/section_index.html
+++ b/templates/section_index.html
@@ -6,7 +6,7 @@
     {% for child in page.children | filter(attribute="draft", value=false) | sort(attribute="date") | reverse -%}
     {% if child.title -%}
     <li><a href="{{base_url | trim_end_matches(pat='/') | safe}}{{child.absolute_path | safe}}">{% if child.date -%}
-            <time datetime="{{ child.date }}">{{ child.date | date(format="%Y-%m-%d") }}</time> &ndash; {{ child.title
+            <time datetime="{{ child.date }}">{{ child.date | date(format="%F") }}</time> &ndash; {{ child.title
             -}}
             {% else -%}
             {{ child.title -}}