@mr-hope/vuepress-plugin-sitemap
Advanced tools
Comparing version 0.4.0 to 0.4.1
{ | ||
"name": "@mr-hope/vuepress-plugin-sitemap", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "sitemap plugin for vuepress-theme-hope", | ||
@@ -38,3 +38,3 @@ "main": "src/index.js", | ||
}, | ||
"gitHead": "8d3497c497886ea33d1c83a32a007ae7d6e91d5f" | ||
"gitHead": "43c8d17acb58a976112c6d869b70eb4135faa93e" | ||
} |
@@ -56,3 +56,3 @@ "use strict"; | ||
log("Generating sitemap..."); | ||
const { urls = [], hostname, xslUrl, exclude = [], xmlNameSpace: xmlns, } = options; | ||
const { urls = [], hostname, outFile = "sitemap.xml", xslUrl, exclude = [], xmlNameSpace: xmlns, } = options; | ||
const sitemap = new sitemap_1.SitemapStream({ | ||
@@ -63,3 +63,3 @@ hostname: hostname || themeConfig.hostname, | ||
}); | ||
const sitemapXML = path_1.resolve(outDir, options.outFile || "sitemap.xml"); | ||
const sitemapXML = path_1.resolve(outDir, outFile); | ||
const writeStream = fs_1.createWriteStream(sitemapXML); | ||
@@ -86,3 +86,3 @@ sitemap.pipe(writeStream); | ||
}, | ||
plugins: ["@mr-hope/last-update"], | ||
plugins: ["@mr-hope/last-update", ["@vuepress/last-updated", false]], | ||
}); |
@@ -116,9 +116,11 @@ import { PageComputed } from "@mr-hope/vuepress-types"; | ||
export interface SitemapOptions { | ||
/** 网站域名 */ | ||
hostname: string; | ||
/** 需要额外包含的网址 */ | ||
urls?: string[]; | ||
/** 不被收录的页面 */ | ||
exclude: string[]; | ||
exclude?: string[]; | ||
/** 输出的文件名 */ | ||
outFile?: string; | ||
/** 更新频率 */ | ||
/** 页面默认更新频率 */ | ||
changefreq?: | ||
@@ -132,6 +134,4 @@ | "always" | ||
| "never"; | ||
/** 网站域名 */ | ||
hostname: string; | ||
/** 时间格式化器 */ | ||
dateFormatter: ($page: PageComputed) => string; | ||
dateFormatter?: ($page: PageComputed) => string; | ||
xslUrl?: string; | ||
@@ -138,0 +138,0 @@ /** XML namespaces to turn on - all by default */ |
12081