@conduction/docusaurus-preset 3.6.1 → 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.
@@ -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 should ship <lastmod> on every URL. Google treats lastmod
91
- as the only sitemap-level signal that actually informs recrawl
92
- priority, and only when it's trustworthy. Sites that ship priority +
93
- changefreq without lastmod (the Docusaurus default before preset
94
- 3.6.0) get treated as having no freshness signal. */
95
- check('sitemap.xml emits <lastmod> on URLs', () => {
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) return {ok: false, msg: `0 / ${locCount} URLs have <lastmod> — enable sitemap.lastmod in docusaurus.config`};
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/docusaurus-preset",
3
- "version": "3.6.1",
3
+ "version": "3.6.2",
4
4
  "scripts": {
5
5
  "prepack": "node scripts/prepack-bundle-css.js"
6
6
  },