diff --git a/packages/docusaurus-plugin-content-blog/src/__tests__/index.test.ts b/packages/docusaurus-plugin-content-blog/src/__tests__/index.test.ts index 9dfe8f93278f..afad6bffc5da 100644 --- a/packages/docusaurus-plugin-content-blog/src/__tests__/index.test.ts +++ b/packages/docusaurus-plugin-content-blog/src/__tests__/index.test.ts @@ -57,6 +57,7 @@ describe('loadBlog', () => { permalink: noDatePermalink, title: 'no date', }, + truncated: false, }); expect( blogPosts.find(v => v.metadata.title === 'Happy 1st Birthday Slash!') @@ -76,6 +77,7 @@ describe('loadBlog', () => { permalink: '/blog/2019/01/01/date-matter', title: 'date-matter', }, + truncated: false, }); expect( @@ -91,6 +93,7 @@ describe('loadBlog', () => { permalink: '/blog/2019/01/01/date-matter', title: 'date-matter', }, + truncated: false, }); }); }); diff --git a/packages/docusaurus-plugin-content-blog/src/blogUtils.ts b/packages/docusaurus-plugin-content-blog/src/blogUtils.ts index b6f3411302af..35b4bdbdabbe 100644 --- a/packages/docusaurus-plugin-content-blog/src/blogUtils.ts +++ b/packages/docusaurus-plugin-content-blog/src/blogUtils.ts @@ -137,7 +137,7 @@ export async function generateBlogPosts( date, tags: frontMatter.tags, title: frontMatter.title, - truncated: truncateMarker.test(content), + truncated: truncateMarker?.test(content) || false, }, }); }),