diff options
author | Alan Pearce | 2024-04-15 23:13:58 +0200 |
---|---|---|
committer | Alan Pearce | 2024-04-15 23:18:24 +0200 |
commit | 077c8e41d82557bbfc20e30915c92811d25f516a (patch) | |
tree | b666ee70808e22f05a6e26a28f3cb4d4323c87d6 /src/templates.ts | |
parent | 40a27d2ba2988db453b0b4ba2f93dae8e4d99aab (diff) | |
download | website-077c8e41d82557bbfc20e30915c92811d25f516a.tar.lz website-077c8e41d82557bbfc20e30915c92811d25f516a.tar.zst website-077c8e41d82557bbfc20e30915c92811d25f516a.zip |
sort tags
Diffstat (limited to 'src/templates.ts')
-rw-r--r-- | src/templates.ts | 7 |
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}`); |