-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.mjs
56 lines (51 loc) · 1.75 KB
/
index.mjs
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
import common from './modules/Common'
import fs from 'fs';
import sm from "sitemap";
import Process from './modules/Process';
let process = new Process();
/**
* @typedef {array} url
* @property {string} url
* @property {'daily' | 'monthly' | 'weekly'} changefreq
* @property {number} priority
* @property {boolean} lastmodrealtime
* @property {string} lastmod
* @property {array} links
* @property {array} img
*/
/** @type {url[]} */
let urlsList = [];
process.addBasePath(urlsList);
process.addGirlTime(urlsList);
process.addDeviceTime(urlsList);
process.addFairyTime(urlsList);
process.addImageList(urlsList);
process.saveLinkToFile(urlsList);
// noinspection SpellCheckingInspection
let sitemap = sm.createSitemap({
hostname: common.HOST_NAME,
cacheTime: 600000, //600 sec (10 min) cache purge period
urls: urlsList
// [
// {url: '/', changefreq: 'weekly', priority: 0.8, lastmodrealtime: true, lastmod: today},
// {url: '/page1&=1', changefreq: 'weekly', priority: 0.8, lastmodrealtime: true, lastmod: today},
// {
// url: '/page2', changefreq: 'weekly', priority: 0.8, lastmodrealtime: true, lastmod: today,
// img: [{
// url: '/img1.jpg',
// caption: 'An image',
// title: 'The Title of Image One'
// },],
// links: [
// {lang: 'en', url: 'http://test.com/page-1/',},
// {lang: 'ja', url: 'http://test.com/page-1/ja/',},
// {lang: 'zh-Hans', url: 'http://test.com/page-1/ja/',},
// {lang: 'zh-Hant', url: 'http://test.com/page-1/ja/',},
//
//
// ]
// }
// ]
});
// console.log(sitemap);
fs.writeFileSync("./sitemap.xml", sitemap.toString());