Nuxt Content and Feed

Posted on July 10, 2020

Here my solution to create a feed.xml with Nuxt and the @nuxt/content module by using @nuxtjs/feed.

First, in nuxt.config.js, I create the routes array using the content hook content:file:beforeInsert, and, in the same function, I prepare the content for the feed article, since I want to use HTML instead markdown:

hooks: {
  'content:file:beforeInsert': d => {
    d.html = marked(d.text)

then, the setting for the feed module:

feed: [
    path: '/feed.xml',
    create feed {
      console.log( => d.path))
      feed.options = {
        title: 'Example',
        link: '',
        description: 'Nuxt RSS feed'

      routes.forEach(post => {
          title: post.title,
          id: post.path,
          link: `${post.path}`,
          content: post.html

    type: 'rss2'

Hope this help.