fuc-new/doc/node_modules/@vuepress/plugin-sitemap/lib/node/getSitemapTemplate.js
hellcat 6adbc04d4b 1
2025-10-03 17:17:08 +08:00

12 lines
530 B
JavaScript

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