Open asencis opened 3 years ago
Did you found a solution for this?
I made it work with this in my nuxt.config.js
import Prismic from '@prismicio/client'
feed: [
// A default feed configuration object
{
path: '/feed.xml',
async create(feed) {
feed.options = {
title: 'My Title',
link: 'https://www.domain.com/feed.xml',
description: 'My description',
}
const api = await Prismic.getApi('https://domain.cdn.prismic.io/api/v2')
const blogposts = await api.query(Prismic.Predicates.at('document.type', 'blogpost'))
blogposts.results.forEach((post) => {
feed.addItem({
title: post.data.meta_title,
id: `https://www.domain.com/${post.uid}/`,
link: `https://www.domain.com/${post.uid}/`,
description: post.data.meta_description,
date: new Date(post.data.post_date),
})
})
},
cacheTime: 1000 * 60 * 15,
type: 'rss2',
},
],
Does anyone have a solution for using $primsic (the official nuxt plugin version) with the
async create (feed) {}
call?