feed-module
feed-module copied to clipboard
The basic exemple of this module not working
trafficstars
The basic exemple of this module not working...
I haven't error, but the result is:
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>undefined</title>
<link>undefined</link>
<description>undefined</description>
<lastBuildDate>Sat, 27 Nov 2021 11:34:25 GMT</lastBuildDate>
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
<generator>https://github.com/nuxt-community/feed-module</generator>
</channel>
</rss>
The code in nuxt.config.js:
feed: [
{
path: '/feed.xml',
// cacheTime: 1000 * 60 * 15,
cacheTime: -1,
type: 'rss2',
data: [],
feed (feed) {
feed.options = {
title: 'My blog',
link: 'https://lichter.io/feed.xml',
description: 'This is my personal feed!'
}
}
}
]
I very need of this module :/
Not sure if you figured this out since, but your feed(feed){} should be create(feed){}, if you want a function on a per-feed basis. You can alternatively use a function for the feed property of your nuxt config (which is an array in your code) and return an array of feed configs.
Your nuxt.config.js should be
{
feed: [
// ...
create(feed) {}
]
}
or
{
feed() {
return [
{
// ...
create(feed) {}
}
]
}
}