@conduction/docusaurus-preset 3.6.0 → 3.6.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.
- package/bin/validate-ai-baseline.mjs +14 -8
- package/package.json +1 -1
- package/src/index.js +4 -2
|
@@ -87,19 +87,25 @@ check('sitemap.xml exists and has at least 1 URL', () => {
|
|
|
87
87
|
return {ok: true, msg: `${n} URLs`};
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
-
/* sitemap.xml
|
|
91
|
-
as the only sitemap-level signal that actually informs
|
|
92
|
-
priority,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
/* sitemap.xml lastmod check is informational only. Google treats
|
|
91
|
+
lastmod as the only sitemap-level signal that actually informs
|
|
92
|
+
recrawl priority, but applying it requires per-site docusaurus.config
|
|
93
|
+
changes (sites that override `presets:` don't pick up the preset's
|
|
94
|
+
DEFAULT_SITEMAP_OPTIONS automatically). Warning here surfaces the
|
|
95
|
+
gap without blocking deploy on fleet sites that haven't adopted
|
|
96
|
+
the new sitemap config yet. Promote back to hard-fail in a future
|
|
97
|
+
release once the preset wraps user presets to inject sitemap defaults
|
|
98
|
+
automatically. */
|
|
99
|
+
check('sitemap.xml emits <lastmod> on URLs (advisory, not fatal)', () => {
|
|
96
100
|
const body = readBuild('sitemap.xml');
|
|
97
101
|
const locCount = (body.match(/<loc>/g) || []).length;
|
|
98
102
|
const lastmodCount = (body.match(/<lastmod>/g) || []).length;
|
|
99
103
|
if (locCount === 0) return {ok: false, msg: 'no <loc> entries to compare against'};
|
|
100
|
-
if (lastmodCount === 0)
|
|
104
|
+
if (lastmodCount === 0) {
|
|
105
|
+
/* Surface as a "passed with note" rather than fail. */
|
|
106
|
+
return {ok: true, msg: `WARN 0 / ${locCount} URLs have <lastmod> (enable sitemap.lastmod in docusaurus.config)`};
|
|
107
|
+
}
|
|
101
108
|
const ratio = lastmodCount / locCount;
|
|
102
|
-
if (ratio < 0.5) return {ok: false, msg: `only ${lastmodCount} / ${locCount} URLs have <lastmod>`};
|
|
103
109
|
return {ok: true, msg: `${lastmodCount} / ${locCount} URLs (${Math.round(ratio * 100)}%)`};
|
|
104
110
|
});
|
|
105
111
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -232,9 +232,11 @@ function buildAiHeadTags(opts) {
|
|
|
232
232
|
*
|
|
233
233
|
* Sites with locale-specific tag pages and pagination should keep the
|
|
234
234
|
* exclude list in sync. Pagination (`/page/N/`) and tag pages
|
|
235
|
-
* (`/tags
|
|
235
|
+
* (`/tags/{slug}/`) are documented Docusaurus duplicate-content traps;
|
|
236
236
|
* we exclude them by default so they neither dilute crawl budget nor
|
|
237
|
-
* confuse AI summarisers.
|
|
237
|
+
* confuse AI summarisers. (Do not write `/tags/*` followed by a slash
|
|
238
|
+
* in this comment: the literal asterisk-slash sequence would close
|
|
239
|
+
* the JSDoc block and break preset parsing for every consuming site.)
|
|
238
240
|
*/
|
|
239
241
|
const DEFAULT_SITEMAP_OPTIONS = {
|
|
240
242
|
changefreq: null,
|