-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext-sitemap.config.js
More file actions
68 lines (64 loc) · 1.85 KB
/
Copy pathnext-sitemap.config.js
File metadata and controls
68 lines (64 loc) · 1.85 KB
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
65
66
67
68
/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: process.env.NEXT_PUBLIC_BASE_URL || 'https://typweaver.com',
generateRobotsTxt: true,
generateIndexSitemap: true,
// Exclude these paths from sitemap
exclude: [
'/api/*',
'/_next/*',
'/404',
'/500',
],
// Additional paths to include
additionalPaths: async (config) => [
await config.transform(config, '/'),
await config.transform(config, '/docs'),
await config.transform(config, '/docs/commitweave'),
await config.transform(config, '/docs/commitweave/installation'),
await config.transform(config, '/docs/commitweave/usage'),
await config.transform(config, '/docs/commitweave/configuration'),
await config.transform(config, '/docs/commitweave/cli-reference'),
await config.transform(config, '/docs/commitweave/vscode-extension'),
await config.transform(config, '/docs/glin-profanity'),
],
// Transform function to customize URLs
transform: async (config, path) => {
return {
loc: path,
changefreq: path === '/' || path === '/docs' ? 'daily' : 'weekly',
priority: path === '/' || path === '/docs' ? 1.0 : path.includes('/docs/') ? 0.8 : 0.6,
lastmod: new Date().toISOString(),
alternateRefs: [],
}
},
// Robots.txt configuration
robotsTxtOptions: {
policies: [
{
userAgent: '*',
allow: '/',
disallow: ['/api/', '/_next/', '/admin/'],
},
{
userAgent: 'GPTBot',
disallow: '/',
},
{
userAgent: 'ChatGPT-User',
disallow: '/',
},
{
userAgent: 'CCBot',
disallow: '/',
},
{
userAgent: 'anthropic-ai',
disallow: '/',
},
],
additionalSitemaps: [
`${process.env.NEXT_PUBLIC_BASE_URL || 'https://typweaver.com'}/sitemap.xml`,
],
},
}