all repos — homestead @ 234fa3c80cc83cbe99a8eddcdccefd134d61f103

Code for my website

sort tags

Alan Pearce
commit

234fa3c80cc83cbe99a8eddcdccefd134d61f103

parent

f5da5a3bb0303cb74ab6517d9ecaa8ad0b958de9

1 file changed, 5 insertions(+), 2 deletions(-)

jump to
M src/templates.tssrc/templates.ts
@@ -111,7 +111,7 @@ $(".h-entry .e-content").html(content);
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 @@ }
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}`);