@antv/dumi-theme-antv 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -42,7 +42,7 @@ var path = __toESM(require("path"));
|
|
|
42
42
|
var defaultConfig = {
|
|
43
43
|
enable: true,
|
|
44
44
|
distDir: "dist",
|
|
45
|
-
checkExternalLinks:
|
|
45
|
+
checkExternalLinks: false,
|
|
46
46
|
ignorePatterns: ["^#", "^mailto:", "^tel:", "^javascript:", "^data:", ".*stackoverflow\\.com.*"],
|
|
47
47
|
fileExtensions: [".html"],
|
|
48
48
|
failOnError: false,
|
|
@@ -85,6 +85,13 @@ function writeSitemap(config, urls) {
|
|
|
85
85
|
import_fs.default.writeFileSync(import_path.default.join(config.outputDir, config.filename), sitemapContent);
|
|
86
86
|
console.log(import_chalk.default.green(`✅ Sitemap generated including ${urls.length} urls. `));
|
|
87
87
|
}
|
|
88
|
+
function generateRobotsTxt(config) {
|
|
89
|
+
const robotsContent = `User-agent: *
|
|
90
|
+
Allow: /
|
|
91
|
+
|
|
92
|
+
Sitemap: ${config.siteUrl}/sitemap.xml`;
|
|
93
|
+
import_fs.default.writeFileSync(import_path.default.join(config.outputDir, "robots.txt"), robotsContent);
|
|
94
|
+
}
|
|
88
95
|
function generateSitemap(api) {
|
|
89
96
|
const getConfig = () => {
|
|
90
97
|
const themeConfig = api.config.themeConfig || {};
|
|
@@ -100,4 +107,5 @@ function generateSitemap(api) {
|
|
|
100
107
|
}
|
|
101
108
|
const urls = generateUrls(config);
|
|
102
109
|
writeSitemap(config, urls);
|
|
110
|
+
generateRobotsTxt(config);
|
|
103
111
|
}
|