about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-04-15 23:13:58 +0200
committerAlan Pearce2024-04-15 23:18:24 +0200
commit077c8e41d82557bbfc20e30915c92811d25f516a (patch)
treeb666ee70808e22f05a6e26a28f3cb4d4323c87d6
parent40a27d2ba2988db453b0b4ba2f93dae8e4d99aab (diff)
downloadwebsite-077c8e41d82557bbfc20e30915c92811d25f516a.tar.lz
website-077c8e41d82557bbfc20e30915c92811d25f516a.tar.zst
website-077c8e41d82557bbfc20e30915c92811d25f516a.zip
sort tags
-rw-r--r--src/templates.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/templates.ts b/src/templates.ts
index 84ae695..8099065 100644
--- a/src/templates.ts
+++ b/src/templates.ts
@@ -111,7 +111,7 @@ async function renderPost(file: Post, content: string) {
   const categories = $(".h-entry .p-categories");
   const cat = categories.find(".p-category").parentsUntil(categories);
   cat.remove();
-  for (const tag of file.taxonomies["tags"]) {
+  for (const tag of file.taxonomies["tags"].sort()) {
     categories.append(
       cat
         .clone()
@@ -230,7 +230,10 @@ export default async function generateSite() {
   await fs.mkdir("public/tags", { recursive: true });
   tasks.push(async () => {
     log.debug("Rendering tags page to public/tags/index.html");
-    return fs.writeFile("public/tags/index.html", await renderTags([...tags]));
+    return fs.writeFile(
+      "public/tags/index.html",
+      await renderTags([...tags].sort()),
+    );
   });
   for (const tag of tags) {
     log.debug(`Processing tag ${tag}`);