about summary refs log tree commit diff stats
path: root/src/templates.ts
diff options
context:
space:
mode:
authorAlan Pearce2024-04-11 16:43:56 +0200
committerAlan Pearce2024-04-11 16:43:56 +0200
commitb696c32da597727126980f205be5e1e1e5c3c2cd (patch)
treeba891872cafc4698691a721d76fd6bd7ee51024c /src/templates.ts
parent03d58d23df0df365c3bed234d48119511308533d (diff)
downloadwebsite-b696c32da597727126980f205be5e1e1e5c3c2cd.tar.lz
website-b696c32da597727126980f205be5e1e1e5c3c2cd.tar.zst
website-b696c32da597727126980f205be5e1e1e5c3c2cd.zip
Clean up according to TS hints
Diffstat (limited to 'src/templates.ts')
-rw-r--r--src/templates.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/templates.ts b/src/templates.ts
index 4f8ab9f..2b6f589 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"]) {
     categories.append(
       cat
         .clone()
@@ -230,7 +230,9 @@ export default async function generateSite() {
   });
   for (const tag of tags) {
     log.debug(`Processing tag ${tag}`);
-    const matchingPosts = posts.filter((p) => p.taxonomies.tags.includes(tag));
+    const matchingPosts = posts.filter((p) =>
+      p.taxonomies["tags"].includes(tag),
+    );
     await fs.mkdir(`public/tags/${tag}`, { recursive: true });
     tasks.push(async () => {
       log.debug(`Rendering tag ${tag} to public/tags/${tag}/index.html`);