-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathnext-sitemap.config.js
More file actions
48 lines (45 loc) · 883 Bytes
/
next-sitemap.config.js
File metadata and controls
48 lines (45 loc) · 883 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
44
45
46
47
48
/** @type {import('next-sitemap').IConfig} */
const sitemapConfig = {
siteUrl: "https://swapi.info",
generateIndexSitemap: false,
changefreq: "monthly",
outDir: "out", // Required for static export
exclude: [
"/api/*",
"/opengraph-image.jpg",
"/twitter-image.jpg",
"/robots.txt",
"/_not-found",
],
transform: async (config, path) => {
// Priority based on page type
let priority = 0.7
if (path === "/") {
priority = 1.0
} else if (
path === "/documentation" ||
path === "/about" ||
path === "/playground"
) {
priority = 0.9
} else if (
[
"/films",
"/people",
"/planets",
"/species",
"/starships",
"/vehicles",
].includes(path)
) {
priority = 0.8
}
return {
loc: path,
changefreq: config.changefreq,
priority,
lastmod: new Date().toISOString(),
}
},
}
module.exports = sitemapConfig