🌐 AI搜索 & 代理 主页
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions docs/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,18 @@ module.exports = {
},

// We only include a populated `sitemap.xml` in production docs
sitemap: {
// Sitemaps requires a hostname, so we use localhost in
// non-prod mode just to make the sitemap module happy
hostname: IS_PROD_DOCS ? BASE_URL : 'http://localhost',
// Exclude all static routes when not prod
// Exclude only redirect routes in prod
exclude: IS_PROD_DOCS ? ['/docs/misc', '/docs/misc/**', '/docs/layout'] : ['/', '/**'],
// Include dynamic slug routes (from `generate.routes`) in prod, while
// in non-prod docs we do not include dynamic routes (empty array)
...(IS_PROD_DOCS ? {} : { routes: [] })
sitemap: () => {
// Don't generate a sitemap for non-production docs
if (!IS_PROD_DOCS) {
return false
}
return {
hostname: BASE_URL,
// Exclude any redirect pages from sitemaps
exclude: ['/docs/misc', '/docs/misc/**', '/docs/layout'],
// Default properties to apply to each URL entry
defaults: { changefreq: 'weekly', lastmod: new Date().toISOString() }
}
},

head: {
Expand Down