-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnext-sitemap.config.js
52 lines (48 loc) · 1.1 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// @ts-check
/**
* @name isServerSidePath
* @param {string} path
*/
function isServerSidePath(path) {
if (path.includes("news/")) return true;
if (path.includes("radio/")) return true;
if (path.includes("artists/")) return true;
return false;
}
/**
* @type {import('next-sitemap').IConfig}
*/
module.exports = {
siteUrl: "https://refugeworldwide.com",
generateRobotsTxt: true,
exclude: ["/server-sitemap.xml"],
robotsTxtOptions: {
additionalSitemaps: ["https://refugeworldwide.com/server-sitemap.xml"],
policies: [
{
userAgent: "*",
allow: "/",
disallow: [
"/admin/",
"/admin/calendar",
"/signin",
"/submission",
"/community-feedback",
"/residents-feedback",
"/submission-v2",
],
},
],
},
transform: (config, path) => {
if (isServerSidePath(path)) {
return null;
}
return {
loc: path,
changefreq: config.changefreq,
priority: config.priority,
lastmod: config.autoLastmod ? new Date().toISOString() : undefined,
};
},
};