Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(blog): type buildBlog() param type #9830

Merged
merged 3 commits into from
Oct 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading