diff options
author | Alan Pearce | 2024-04-11 16:43:56 +0200 |
---|---|---|
committer | Alan Pearce | 2024-04-11 16:43:56 +0200 |
commit | b696c32da597727126980f205be5e1e1e5c3c2cd (patch) | |
tree | ba891872cafc4698691a721d76fd6bd7ee51024c /src/posts.ts | |
parent | 03d58d23df0df365c3bed234d48119511308533d (diff) | |
download | website-b696c32da597727126980f205be5e1e1e5c3c2cd.tar.lz website-b696c32da597727126980f205be5e1e1e5c3c2cd.tar.zst website-b696c32da597727126980f205be5e1e1e5c3c2cd.zip |
Clean up according to TS hints
Diffstat (limited to 'src/posts.ts')
-rw-r--r-- | src/posts.ts | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/posts.ts b/src/posts.ts index e15accb..2b678b9 100644 --- a/src/posts.ts +++ b/src/posts.ts @@ -2,7 +2,6 @@ import path from "node:path"; import fs from "node:fs/promises"; import { matter } from "toml-matter"; -import * as marked from "marked"; type MatterFile = ReturnType<typeof matter>; @@ -30,7 +29,6 @@ export async function readPosts( let posts = new Array<Post>(); const subdir = path.join(root, inputDir); for (let pathname of await fs.readdir(subdir)) { - const pathFromDir = path.join(inputDir, pathname); const pathFromRoot = path.join(subdir, pathname); const stat = await fs.stat(pathFromRoot); if (stat.isFile() && path.extname(pathname) === ".md") { @@ -43,7 +41,7 @@ export async function readPosts( const file = await getPost(input); - (file.data.taxonomies as any)?.tags?.map((t: string) => + (file.data["taxonomies"] as any)?.tags?.map((t: string) => tags.add(t.toLowerCase()), ); posts.push({ |