mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
feat(blog): allow processing blog posts through a processBlogPosts function (#9886)
Co-authored-by: OzakIOne <OzakIOne@users.noreply.github.com> Co-authored-by: sebastien <lorber.sebastien@gmail.com> Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
This commit is contained in:
parent
05279dc3d8
commit
2851c93d0d
12 changed files with 400 additions and 6 deletions
|
@ -20,11 +20,12 @@ import {
|
|||
DEFAULT_PLUGIN_ID,
|
||||
} from '@docusaurus/utils';
|
||||
import {
|
||||
generateBlogPosts,
|
||||
getSourceToPermalink,
|
||||
getBlogTags,
|
||||
paginateBlogPosts,
|
||||
shouldBeListed,
|
||||
applyProcessBlogPosts,
|
||||
generateBlogPosts,
|
||||
} from './blogUtils';
|
||||
import footnoteIDFixer from './remark/footnoteIDFixer';
|
||||
import {translateContent, getTranslationFiles} from './translations';
|
||||
|
@ -113,7 +114,11 @@ export default async function pluginContentBlog(
|
|||
|
||||
const baseBlogUrl = normalizeUrl([baseUrl, routeBasePath]);
|
||||
const blogTagsListPath = normalizeUrl([baseBlogUrl, tagsBasePath]);
|
||||
const blogPosts = await generateBlogPosts(contentPaths, context, options);
|
||||
let blogPosts = await generateBlogPosts(contentPaths, context, options);
|
||||
blogPosts = await applyProcessBlogPosts({
|
||||
blogPosts,
|
||||
processBlogPosts: options.processBlogPosts,
|
||||
});
|
||||
const listedBlogPosts = blogPosts.filter(shouldBeListed);
|
||||
|
||||
if (!blogPosts.length) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue