-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
next-sitemap.js
60 lines (60 loc) · 1.2 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
module.exports = {
siteUrl: 'https://tina.io',
generateRobotsTxt: true,
robotsTxtOptions: {
policies: [
{
userAgent: '*',
disallow: ['/api/*', '/github/*', '/rss.xml', '/blog/page/*'],
},
{ userAgent: '*', allow: '/' },
],
},
exclude: ['/api/*', '/github/*', '/rss.xml', '/blog/page/*'],
sitemapSize: 7000,
transform: async (config, path) => {
const listOfMinorPaths = [
'/privacy-notice',
'/security',
'/terms-of-service',
]
if (listOfMinorPaths.includes(path)) {
return {
loc: path,
priority: 0.3,
}
}
if (path === '/') {
return {
loc: path,
changefreq: 'daily',
priority: 1.0,
}
}
if (path.indexOf('/docs/') > -1) {
return {
loc: path,
changefreq: 'weekly',
priority: 0.5,
}
}
if (path.indexOf('/guides/') > -1) {
return {
loc: path,
priority: 0.5,
}
}
if (path.indexOf('/blog/') > -1) {
return {
loc: path,
changefreq: 'monthly',
priority: 0.5,
}
}
return {
loc: path,
priority: 0.7,
changefreq: 'weekly',
}
},
}