-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext-sitemap.config.js
64 lines (58 loc) · 1.68 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
53
54
55
56
57
58
59
60
61
62
63
64
/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: process.env.SITE_URL?.replace(/\/$/, "") || "https://devseek-ai.vercel.app",
generateRobotsTxt: true,
sitemapSize: 5000,
changefreq: "daily",
priority: 0.7,
exclude: [
"/twitter-image*",
"/opengraph-image*",
"/icon*",
"/apple-icon.png",
"/thankyou"
],
additionalPaths: async (config) => {
return Promise.resolve([
{
loc: `${config.siteUrl}/signin`,
lastmod: new Date().toISOString(),
changefreq: "monthly",
priority: 0.9,
},
{
loc: `${config.siteUrl}/tos`,
lastmod: new Date().toISOString(),
changefreq: "yearly",
priority: 0.3,
},
{
loc: `${config.siteUrl}/privacy-policy`,
lastmod: new Date().toISOString(),
changefreq: "yearly",
priority: 0.3,
},
// ✅ Manually added blog URLs with highest priority
{
loc: `${config.siteUrl}/blog/will-ai-replace-developers-2025`,
lastmod: new Date().toISOString(),
changefreq: "hourly", // 🔥 Tells Google this updates frequently
priority: 1.0, // 🔥 Highest priority for fastest indexing
},
]);
},
robotsTxtOptions: {
additionalSitemaps: [
"https://devseek-ai.vercel.app/sitemap-0.xml"
],
},
transform: async (config, url) => {
console.log("Sitemap URL:", url);
return {
loc: url.startsWith("http") ? url : `${config.siteUrl}${url}`,
lastmod: new Date().toISOString(),
changefreq: url.includes("/blog/") ? "hourly" : "daily", // 🔥 Hourly for blogs
priority: url.includes("/blog/") ? 1.0 : 0.7,
};
},
};