mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-20 04:27:04 +02:00
fix(v2): linkify blog posts (#2326)
* fix(v2): linkify blog posts * Fix tests
This commit is contained in:
parent
84eeb5120c
commit
36163773ec
8 changed files with 161 additions and 12 deletions
|
@ -18,6 +18,7 @@ import {
|
|||
TagsModule,
|
||||
BlogPaginated,
|
||||
FeedType,
|
||||
BlogPost,
|
||||
} from './types';
|
||||
import {
|
||||
LoadContext,
|
||||
|
@ -75,6 +76,7 @@ export default function pluginContentBlog(
|
|||
generatedFilesDir,
|
||||
'docusaurus-plugin-content-blog',
|
||||
);
|
||||
let blogPosts: BlogPost[] = [];
|
||||
|
||||
return {
|
||||
name: 'docusaurus-plugin-content-blog',
|
||||
|
@ -89,8 +91,8 @@ export default function pluginContentBlog(
|
|||
async loadContent() {
|
||||
const {postsPerPage, routeBasePath} = options;
|
||||
|
||||
const blogPosts = await generateBlogPosts(contentPath, context, options);
|
||||
if (!blogPosts) {
|
||||
blogPosts = await generateBlogPosts(contentPath, context, options);
|
||||
if (!blogPosts.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -391,7 +393,10 @@ export default function pluginContentBlog(
|
|||
{
|
||||
loader: path.resolve(__dirname, './markdownLoader.js'),
|
||||
options: {
|
||||
siteDir,
|
||||
contentPath,
|
||||
truncateMarker,
|
||||
blogPosts,
|
||||
},
|
||||
},
|
||||
].filter(Boolean) as Loader[],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue