about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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>