Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The basic exemple of this module not working #100

Open
pirmax opened this issue Nov 27, 2021 · 1 comment
Open

The basic exemple of this module not working #100

pirmax opened this issue Nov 27, 2021 · 1 comment

Comments

@pirmax
Copy link

pirmax commented Nov 27, 2021

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 :/

@apttx
Copy link

apttx commented May 9, 2022

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) {}
      }
    ]
  }
}

@NozomuIkuta NozomuIkuta mentioned this issue Jul 21, 2022
28 tasks
@NozomuIkuta NozomuIkuta mentioned this issue Dec 14, 2022
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants