test02/node_modules/@vuepress/plugin-sitemap/lib/node/getSitemapTemplate.js
罗佳鸿 6aa1ebe342
Some checks are pending
部署文档 / deploy-gh-pages (push) Waiting to run
first commit
2024-08-13 10:11:19 +08:00

12 lines
530 B
JavaScript

import { getRealPath } from '@vuepress/helper';
import { removeLeadingSlash } from 'vuepress/shared';
import { fs } from 'vuepress/utils';
import { PLUGIN_NAME } from './logger.js';
const DEFAULT_TEMPLATE_PATH = getRealPath(`${PLUGIN_NAME}/templates/sitemap.xsl`, import.meta.url);
export const getSiteMapTemplate = (options) => [
options.sitemapXSLFilename
? removeLeadingSlash(options.sitemapXSLFilename)
: 'sitemap.xsl',
options.sitemapXSLTemplate ?? fs.readFileSync(DEFAULT_TEMPLATE_PATH, 'utf-8'),
];