mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-09 14:22:27 +02:00
feat(content-blog): add full blog post html into RSS/Atom feeds (#4330)
Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
198590446a
commit
6ed698976d
15 changed files with 377 additions and 18 deletions
|
@ -246,23 +246,26 @@ describe('loadBlog', () => {
|
|||
test('simple website blog dates localized', async () => {
|
||||
const siteDir = path.join(__dirname, '__fixtures__', 'website');
|
||||
const blogPostsFrench = await getBlogPosts(siteDir, {}, getI18n('fr'));
|
||||
expect(blogPostsFrench).toHaveLength(6);
|
||||
expect(blogPostsFrench).toHaveLength(7);
|
||||
expect(blogPostsFrench[0].metadata.formattedDate).toMatchInlineSnapshot(
|
||||
`"16 août 2020"`,
|
||||
`"5 mars 2021"`,
|
||||
);
|
||||
expect(blogPostsFrench[1].metadata.formattedDate).toMatchInlineSnapshot(
|
||||
`"15 août 2020"`,
|
||||
`"16 août 2020"`,
|
||||
);
|
||||
expect(blogPostsFrench[2].metadata.formattedDate).toMatchInlineSnapshot(
|
||||
`"27 février 2020"`,
|
||||
`"15 août 2020"`,
|
||||
);
|
||||
expect(blogPostsFrench[3].metadata.formattedDate).toMatchInlineSnapshot(
|
||||
`"2 janvier 2019"`,
|
||||
`"27 février 2020"`,
|
||||
);
|
||||
expect(blogPostsFrench[4].metadata.formattedDate).toMatchInlineSnapshot(
|
||||
`"1 janvier 2019"`,
|
||||
`"2 janvier 2019"`,
|
||||
);
|
||||
expect(blogPostsFrench[5].metadata.formattedDate).toMatchInlineSnapshot(
|
||||
`"1 janvier 2019"`,
|
||||
);
|
||||
expect(blogPostsFrench[6].metadata.formattedDate).toMatchInlineSnapshot(
|
||||
`"14 décembre 2018"`,
|
||||
);
|
||||
});
|
||||
|
@ -292,7 +295,7 @@ describe('loadBlog', () => {
|
|||
expect(blogPost.metadata.editUrl).toEqual(hardcodedEditUrl);
|
||||
});
|
||||
|
||||
expect(editUrlFunction).toHaveBeenCalledTimes(6);
|
||||
expect(editUrlFunction).toHaveBeenCalledTimes(7);
|
||||
expect(editUrlFunction).toHaveBeenCalledWith({
|
||||
blogDirPath: 'blog',
|
||||
blogPath: 'date-matter.md',
|
||||
|
@ -305,6 +308,12 @@ describe('loadBlog', () => {
|
|||
permalink: '/blog/draft',
|
||||
locale: 'en',
|
||||
});
|
||||
expect(editUrlFunction).toHaveBeenCalledWith({
|
||||
blogDirPath: 'blog',
|
||||
blogPath: 'mdx-blog-post.mdx',
|
||||
permalink: '/blog/mdx-blog-post',
|
||||
locale: 'en',
|
||||
});
|
||||
expect(editUrlFunction).toHaveBeenCalledWith({
|
||||
blogDirPath: 'blog',
|
||||
blogPath: 'complex-slug.md',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue