-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext-sitemap.js
36 lines (36 loc) · 914 Bytes
/
next-sitemap.js
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
function pathToPriority(path) {
if (path === '/') {
return '0.7';
}
if (path === '/modified-worktree') {
return '0.0';
}
if (path.startsWith('/box/')) {
if (path.endsWith('/info')) {
return '0.9';
}
return '0.7';
}
return null;
}
module.exports = {
siteUrl: 'https://stimbox.space',
sourceDir: 'site/.next',
generateRobotsTxt: true,
sitemapSize: 7000,
changefreq: 'daily',
outDir: 'dist',
priority: '0.5',
robotsTxtOptions: {
policies: [{ userAgent: '*', allow: '/' }],
},
transform(config, path) {
const overridePriority = pathToPriority(path);
return {
loc: path, // => this will be exported as http(s)://<config.siteUrl>/<path>
changefreq: config.changefreq,
priority: overridePriority != null ? overridePriority : config.priority,
lastmod: config.autoLastmod ? new Date().toISOString() : undefined,
};
},
};