-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext-sitemap.js
More file actions
30 lines (30 loc) · 792 Bytes
/
next-sitemap.js
File metadata and controls
30 lines (30 loc) · 792 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
module.exports = {
siteUrl: process.env.NEXT_PUBLIC_SITE_URL || 'https://devlog.rweb.site',
generateRobotsTxt: true,
outDir: './public',
changefreq: 'weekly',
priority: 0.7,
sitemapSize: 70000,
generateIndexSitemap: false,
transform: async (config, url) => {
const isHomepage = url === '/';
return {
loc: new URL(url, config.siteUrl).toString(),
lastmod: new Date().toISOString(),
changefreq: isHomepage ? 'daily' : config.changefreq,
priority: isHomepage ? 1.0 : config.priority,
};
},
robotsTxtOptions: {
policies: [
{
userAgent: '*',
allow: '/',
},
],
additionalSitemaps: [
'https://devlog.rweb.site/sitemap.xml',
'https://devlog.rweb.site/rss.xml', // RSS feed URL
],
},
};