Skip to content

Commit

Permalink
chore(blog): type buildBlog() param type (#9830)
Browse files Browse the repository at this point in the history
* chore(build/blog): add buildBlog() param type

* chore(build/blog): avoid render() requiring full doc

* fix(build/blog): remove unset modified property
  • Loading branch information
caugner authored Oct 27, 2023
1 parent d533e90 commit 55d9d83
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions build/blog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -358,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,
Expand Down Expand Up @@ -402,8 +412,6 @@ export async function buildPost(
throw error;
}

doc.modified = metadata.modified || null;

doc.pageTitle = `${doc.title} | MDN Blog`;

doc.noIndexing = false;
Expand Down

0 comments on commit 55d9d83

Please sign in to comment.