-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathnext-sitemap.js
More file actions
43 lines (40 loc) · 993 Bytes
/
Copy pathnext-sitemap.js
File metadata and controls
43 lines (40 loc) · 993 Bytes
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
const { GFW_DOMAIN } = require('./utils/domain');
module.exports = {
siteUrl: GFW_DOMAIN,
generateRobotsTxt: true,
robotsTxtOptions: {
policies: [{ userAgent: '*', allow: '/' }],
additionalSitemaps: [`${GFW_DOMAIN}/help/sitemap.xml`],
},
sitemapSize: 50000,
priority: 1.0,
changefreq: 'weekly',
exclude: [
'/404',
'/search',
'/thank-you',
'/terms',
'/my-gnw',
'/privacy-policy',
'/subscribe',
],
transform: (config, url) => {
if (url.includes('/embed')) {
return null;
}
if (url.includes('/map') || url.includes('/dashboards')) {
return {
loc: url,
changefreq: config.changefreq,
priority: config.priority,
lastmod: config.autoLastmod ? new Date().toISOString() : undefined,
};
}
return {
loc: url,
changefreq: config.changefreq,
priority: config.priority,
lastmod: config.autoLastmod ? new Date().toISOString() : undefined,
};
},
};