We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@nuxtjs/sitemap can generate a sitemap dynamically by specifying the routes option. But @nuxt/content doesn't support sitemap generation.
@nuxtjs/sitemap
routes
@nuxt/content
Update sitemapOptions on the occurrence of the sitemap:generate:before event. https://github.com/nuxt-community/sitemap-module#hooks
sitemapOptions
sitemap:generate:before
Here's a sample code. https://github.com/odanado/blog/blob/8ca87f3dc63477d870f09b24b115cd25f3cd8996/app/modules/sitemap.ts
The text was updated successfully, but these errors were encountered:
If nuxt-community/sitemap-module#143 is resolved, this issue will also be resolved. Therefore, there is no need to do anything.
Sorry, something went wrong.
This is my current workaround to generate a sitemap, don't know if it is the best solution but it works for me.
nuxt.config.js
import path from 'path'; import glob from 'glob'; .... sitemap: { hostname: URL, path: 'sitemap.xml', routes: () => { const files = glob.sync(path.join(__dirname, '/dist/**/*.html')); const urls = files.map(function(file){ const url = path.relative( path.join( __dirname, '/dist/'), file ).replace('index.html', ''); return { url: url, lastmodfile: file } }) return urls; }, i18n: true, cacheTime: 1000 * 60 * 60 * 2, trailingSlash: true, gzip: true }
Cheers Hannes
docs: updated integrations with more information #425 #386 (#479)
83a2cd6
Successfully merging a pull request may close this issue.
Is your feature request related to a problem? Please describe.
@nuxtjs/sitemap
can generate a sitemap dynamically by specifying theroutes
option.But
@nuxt/content
doesn't support sitemap generation.Describe the solution you'd like
Update
sitemapOptions
on the occurrence of thesitemap:generate:before
event.https://github.com/nuxt-community/sitemap-module#hooks
Here's a sample code.
https://github.com/odanado/blog/blob/8ca87f3dc63477d870f09b24b115cd25f3cd8996/app/modules/sitemap.ts
The text was updated successfully, but these errors were encountered: