mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-29 00:47:03 +02:00
refactor(content-blog): clean up type definitions; in-code documentation (#6922)
* refactor(content-blog): clean up type definitions; in-code documentation * add doc
This commit is contained in:
parent
46b1027c4a
commit
8d1c1954c1
16 changed files with 509 additions and 240 deletions
|
@ -29,11 +29,13 @@ async function generateBlogFeed({
|
|||
options,
|
||||
siteConfig,
|
||||
outDir,
|
||||
locale,
|
||||
}: {
|
||||
blogPosts: BlogPost[];
|
||||
options: PluginOptions;
|
||||
siteConfig: DocusaurusConfig;
|
||||
outDir: string;
|
||||
locale: string;
|
||||
}): Promise<Feed | null> {
|
||||
if (!blogPosts.length) {
|
||||
return null;
|
||||
|
@ -47,11 +49,11 @@ async function generateBlogFeed({
|
|||
|
||||
const feed = new Feed({
|
||||
id: blogBaseUrl,
|
||||
title: feedOptions.title || `${title} Blog`,
|
||||
title: feedOptions.title ?? `${title} Blog`,
|
||||
updated,
|
||||
language: feedOptions.language,
|
||||
language: feedOptions.language ?? locale,
|
||||
link: blogBaseUrl,
|
||||
description: feedOptions.description || `${siteConfig.title} Blog`,
|
||||
description: feedOptions.description ?? `${siteConfig.title} Blog`,
|
||||
favicon: favicon ? normalizeUrl([siteUrl, baseUrl, favicon]) : undefined,
|
||||
copyright: feedOptions.copyright,
|
||||
});
|
||||
|
@ -140,17 +142,20 @@ export async function createBlogFeedFiles({
|
|||
options,
|
||||
siteConfig,
|
||||
outDir,
|
||||
locale,
|
||||
}: {
|
||||
blogPosts: BlogPost[];
|
||||
options: PluginOptions;
|
||||
siteConfig: DocusaurusConfig;
|
||||
outDir: string;
|
||||
locale: string;
|
||||
}): Promise<void> {
|
||||
const feed = await generateBlogFeed({
|
||||
blogPosts,
|
||||
options,
|
||||
siteConfig,
|
||||
outDir,
|
||||
locale,
|
||||
});
|
||||
|
||||
const feedTypes = options.feedOptions.type;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue