forked from weijunext/smart-excel-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next-sitemap.config.js
53 lines (53 loc) · 1.42 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
/**
* @type {import('next-sitemap').IConfig}
* @see https://github.com/iamvishnusankar/next-sitemap#readme
* @see https://weijunext.com/article/979b9033-188c-4d88-bfff-6cf74d28420d
*/
module.exports = {
siteUrl: 'https://www.smartexcel.cc',
changefreq: 'daily',
priority: 0.7,
exclude: ['/server-sitemap.xml', '/404'],
generateRobotsTxt: true,
sitemapSize: 5000, // 站点超过5000个,拆分到多个文件
transform: async (config, path) => {
return {
loc: path, // => this will be exported as http(s)://<config.siteUrl>/<path>
changefreq: config.changefreq,
priority: config.priority,
lastmod: config.autoLastmod ? new Date().toISOString() : undefined,
alternateRefs: config.alternateRefs ?? [],
}
},
additionalPaths: async (config) => [
// 这个版本的next-sitemap无法把app router的静态目录加载进来,所以在这里手动添加了
await config.transform(config, '/'),
],
robotsTxtOptions: {
additionalSitemaps: [
'https://www.smartexcel.cc/sitemap.xml',
],
policies: [
{
userAgent: '*',
allow: '/',
},
{
userAgent: 'AhrefsBot',
disallow: ['/'],
},
{
userAgent: 'SemrushBot',
disallow: ['/'],
},
{
userAgent: 'MJ12bot',
disallow: ['/'],
},
{
userAgent: 'DotBot',
disallow: ['/'],
},
],
},
};