Replies: 2 comments
-
|
Any suggestion? |
Beta Was this translation helpful? Give feedback.
0 replies
-
I don't know what you mean here. Show me the code of your attempt and try to explain better. I'm not sure it's a good idea to reparse the html content string to truncate it (you can if you really want to, with cheerio for example), but you can use any blog post metadata or custom front matter to populate the feed item content quite easily: createFeedItems: async (params) => {
const feedItems = await params.defaultCreateFeedItems(params);
return feedItems.map((feedItem, index) => {
const blogPost = params.blogPosts[index]!;
return {
...feedItem,
content: blogPost.metadata.description,
};
});
}, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
I noticed that in the feed xml files, the entire content of the post is passed as the
<content:encoded>element.My posts are large and I would like to pass only the first part, up to the
<!-- truncate -->line.Initially I thought that I can trim the
contentof the post viafeedOptions.createFeedItems, but this was not effective, since thecontentis not used, instead the generated html is read from a file.Beta Was this translation helpful? Give feedback.
All reactions