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

How can i make it work with Nuxt Content v2 ? #43

Closed
furkanavc opened this issue May 4, 2023 · 3 comments
Closed

How can i make it work with Nuxt Content v2 ? #43

furkanavc opened this issue May 4, 2023 · 3 comments

Comments

@furkanavc
Copy link

furkanavc commented May 4, 2023

Details

image
image
i can't make it work can someone help me or if guys have any working example ?
Thank you
I'm using "nuxt-simple-sitemap": "^2.4.22",

@harlan-zw
Copy link
Collaborator

Hey @furkanavc. You can should use the serverQueryContent util like so:

const docs = await serverQueryContent(event).find()
return docs.map(d => ({
   loc: '/news/' + d._path // might be something other than _path
}))

You can see an example on fetching the data here: https://content.nuxtjs.org/guide/recipes/sitemap

@harlan-zw
Copy link
Collaborator

I can look at making this easier, the module would just need to have an idea on your route mapping

@furkanavc
Copy link
Author

@harlan-zw Thank you for the help :)
https://stackblitz.com/edit/nuxt-starter-dwj6e5?file=server%2Fapi%2F_sitemap-urls.ts
this works perfect

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