-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext-sitemap.config.js
More file actions
68 lines (63 loc) · 1.58 KB
/
next-sitemap.config.js
File metadata and controls
68 lines (63 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: process.env.SITE_URL || 'https://chessticks.vercel.app',
generateRobotsTxt: true,
generateIndexSitemap: false,
exclude: ['/api/*', '/admin/*', '/_next/*'],
robotsTxtOptions: {
policies: [
{
userAgent: '*',
allow: '/',
disallow: ['/api/', '/admin/', '/_next/', '/private/']
},
{
userAgent: 'Googlebot',
allow: '/',
disallow: ['/api/', '/admin/', '/_next/', '/private/']
},
{
userAgent: 'Bingbot',
allow: '/',
disallow: ['/api/', '/admin/', '/_next/', '/private/']
}
],
additionalSitemaps: [
'https://chessticks.vercel.app/sitemap.xml',
],
additionalPaths: async (config) => [
await config.transform(config, '/'),
]
},
changefreq: 'weekly',
priority: 1.0,
sitemapSize: 5000,
transform: async (config, path) => {
// Custom priority and changefreq based on path
const customConfig = {
loc: path,
changefreq: 'weekly',
priority: 1.0,
lastmod: new Date().toISOString(),
}
// Home page gets highest priority
if (path === '/') {
customConfig.priority = 1.0
customConfig.changefreq = 'daily'
}
return customConfig
},
additionalPaths: async (config) => {
const result = []
// Add any additional static paths here
const additionalPaths = [
'/',
]
for (const path of additionalPaths) {
result.push(
await config.transform(config, path)
)
}
return result
}
}