From d45577686b08bf0a6c03725fed1922bfdd9a0757 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Tue, 17 Oct 2023 13:02:00 +0200 Subject: [PATCH 1/3] chore(build/blog): add buildBlog() param type --- build/blog.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/build/blog.ts b/build/blog.ts index 708cd599084f..b44f7416de79 100644 --- a/build/blog.ts +++ b/build/blog.ts @@ -344,8 +344,18 @@ export async function buildBlogPosts(options: { } } +interface BlogPostDoc { + url: string; + rawBody: string; + metadata: BlogPostMetadata & { locale: string }; + isMarkdown: boolean; + fileInfo: { + path: string; + }; +} + export async function buildPost( - document + document: BlogPostDoc ): Promise<{ doc: Doc; liveSamples: any }> { const { metadata } = document; From c523f8411494000d8a3e2a9ffef2d52b488e1388 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Tue, 17 Oct 2023 13:02:48 +0200 Subject: [PATCH 2/3] chore(build/blog): avoid render() requiring full doc --- build/blog.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/blog.ts b/build/blog.ts index b44f7416de79..c8592fd4d615 100644 --- a/build/blog.ts +++ b/build/blog.ts @@ -368,7 +368,7 @@ export async function buildPost( let $ = null; const liveSamples: LiveSample[] = []; - [$] = await kumascript.render(document.url, {}, document); + [$] = await kumascript.render(document.url, {}, document as any); const liveSamplePages = await kumascript.buildLiveSamplePages( document.url, From 40b13ecadcb6d9cbeb5d800608c29b7ebe604322 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Tue, 17 Oct 2023 13:05:26 +0200 Subject: [PATCH 3/3] fix(build/blog): remove unset modified property --- build/blog.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/build/blog.ts b/build/blog.ts index c8592fd4d615..d88e2949c6c8 100644 --- a/build/blog.ts +++ b/build/blog.ts @@ -412,8 +412,6 @@ export async function buildPost( throw error; } - doc.modified = metadata.modified || null; - doc.pageTitle = `${doc.title} | MDN Blog`; doc.noIndexing = false;