about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-02-09 14:23:34 +0100
committerAlan Pearce2024-02-09 14:23:34 +0100
commitae5793d52c8b186184c074869aab9386f79acadc (patch)
tree22c58e084f692c231c3aeeef99d45602c6f441fc
parent7d44ee8ea40647f914893d96728612f38fbd91e2 (diff)
downloadwebsite-ae5793d52c8b186184c074869aab9386f79acadc.tar.lz
website-ae5793d52c8b186184c074869aab9386f79acadc.tar.zst
website-ae5793d52c8b186184c074869aab9386f79acadc.zip
Add headings to tag pages
-rw-r--r--src/templates.ts5
-rw-r--r--templates/list.html6
-rw-r--r--templates/tags.html1
3 files changed, 12 insertions, 0 deletions
diff --git a/src/templates.ts b/src/templates.ts
index b8139f6..ac58a2c 100644
--- a/src/templates.ts
+++ b/src/templates.ts
@@ -118,6 +118,11 @@ async function renderListPage(tag: string, posts: Post[]) {
   const $feed = $(".h-feed");
   const $tpl = $(".h-entry").remove();
   $(".title").addClass("p-author h-card").attr("rel", "author");
+  if (tag === "") {
+    $(".filter").remove();
+  } else {
+    $(".filter").find("h3").text(`#${tag}`);
+  }
 
   for (const post of posts) {
     const $post = $tpl.clone();
diff --git a/templates/list.html b/templates/list.html
index 5716b06..ffe29f0 100644
--- a/templates/list.html
+++ b/templates/list.html
@@ -24,6 +24,12 @@
       </nav>
     </header>
     <main id="content">
+      <div class="filter">
+        <h3>Tag</h3>
+        <small>
+          <a href="../">Remove filter</a>
+        </small>
+      </div>
       <ul class="h-feed">
         <li class="h-entry">
           <span>
diff --git a/templates/tags.html b/templates/tags.html
index a724c62..6a58055 100644
--- a/templates/tags.html
+++ b/templates/tags.html
@@ -24,6 +24,7 @@
       </nav>
     </header>
     <main id="content">
+      <h3 style="margin-bottom: 0">Tags</h3>
       <ul class="tags">
         <li class="h-feed">
           <a href="/tags/tag">#tag</a>