We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7d6017 commit a93448dCopy full SHA for a93448d
3 files changed
build/sitemap.js
@@ -0,0 +1,23 @@
1
+const path = require('path');
2
+const fs = require('fs-extra');
3
+const SitemapGenerator = require('sitemap-generator');
4
+
5
+const xmlFile = path.join(process.cwd(), '.deploy/sitemap.xml')
6
+const generator = SitemapGenerator('http://192.168.31.69:1987', {
7
+ maxDepth: 0,
8
+ filepath: xmlFile,
9
+ maxEntriesPerFile: 50000,
10
+ stripQuerystring: true,
11
+ decodeResponses: true,
12
+});
13
14
+// register event listeners
15
+generator.on('done', async () => {
16
+ const str = await fs.readFileSync(xmlFile);
17
+ const newStr = str.toString().replace(/http\:\/\/192\.168\.31\.69\:1987/g, 'https://wangchujiang.com/linux-command');
18
+ await fs.outputFile(xmlFile, newStr);
19
+ console.log('sitemaps created!')
20
21
22
+// start the crawler
23
+generator.start();
0 commit comments