-
I have this config: presets: [
[
'classic',
{
blog: {
showReadingTime: true,
editUrl: 'https://github.com/jcubic/lips-website/tree/docusaurus/docs/',
feedOptions: {
type: 'rss',
limit: 10,
copyright: `Copyright © ${new Date().getFullYear()} Jakub T. Jankiewicz`,
createFeedItems: ({ blogPosts, defaultCreateFeedItems, ...rest }) => {
return defaultCreateFeedItems({
blogPosts: blogPosts.map(({content, ...rest}) => {
const excerpt = content.replace(/<!--\s*truncate\s*-->[\s\S]*$/, '').trim();
console.log({ ...rest, content: excerpt });
return {
...rest,
content: excerpt
}
}),
...rest
});
}
}
}, The excerpt is correct, but RSS includes the whole article. Here is a repro: https://codesandbox.io/p/devbox/blissful-bose-nxrvlq?file=%2Fdocusaurus.config.js%3A68%2C22 Unfortunately, you can't edit markdown files on Code Sandbox, they render as documents like README. I see old discussion to make a way to add full blog article, but I don't see anywhere the option to turns this off: #3719. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
It's impossible, the blog plugin that create the feed just ignores the content and read HTML from the disk with cheerio feed.ts, but there is a workaround. See comments. |
Beta Was this translation helpful? Give feedback.
It's impossible, the blog plugin that create the feed just ignores the content and read HTML from the disk with cheerio feed.ts, but there is a workaround. See comments.