nuxt-community / feed-module

Everyone deserves RSS, ATOM and JSON feeds!
MIT License
226 stars 36 forks source link

Dynamically route #61

Closed The28AWG closed 4 years ago

The28AWG commented 4 years ago

How to redo the module to add dynamic paths? I took addServerMiddleware as a basis and added an express handler. But I do not understand how to cache dynamic paths. Why do we need the following code:

    this.nuxt.hook('generate:done', async () => {
      const xmlGeneratePath = resolve(this.options.rootDir, join(this.options.generate.dir, feedOptions.path))

      writeFileSync(xmlGeneratePath, await feedCache.get(index))
    })
manniL commented 4 years ago

The code linked is only for static sites via nuxt generate