forked from enjidev/enji.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next-sitemap.config.js
38 lines (32 loc) · 879 Bytes
/
next-sitemap.config.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
/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: 'https://www.enji.dev',
priority: 0.6,
generateRobotsTxt: true,
generateIndexSitemap: false,
transform: async (config, path) => {
const defaultValue = (priority) => ({
loc: path,
changefreq: config.changefreq,
priority: priority || config.priority,
lastmod: config.autoLastmod ? new Date().toISOString() : undefined,
alternateRefs: config.alternateRefs ?? [],
});
if (path === '/') {
return defaultValue(1.0);
}
if (path === '/blog') {
return defaultValue(0.9);
}
if (path === '/projects') {
return defaultValue(0.9);
}
if (path === '/today-i-learned') {
return defaultValue(0.9);
}
if (path.indexOf('/work') === 0) {
return defaultValue(0.8);
}
return defaultValue();
},
};