@conduction/docusaurus-preset 3.7.0 → 3.7.1

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,12 +87,19 @@ 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. Preset 3.7+ wraps user-
93
- supplied opts.presets to inject DEFAULT_SITEMAP_OPTIONS (lastmod:
94
- 'date') into any classic preset entry, so every site that bumps
95
- should see lastmod automatically. Hard-fail blocks regression. */
90
+ /* sitemap.xml should ship <lastmod> on the majority of URLs. Google
91
+ treats lastmod as the only sitemap-level signal that actually informs
92
+ recrawl priority, and only when it's trustworthy. Preset 3.7+ wraps
93
+ user-supplied opts.presets to inject DEFAULT_SITEMAP_OPTIONS
94
+ (lastmod: 'date') into any classic preset entry, so every site that
95
+ bumps should see lastmod automatically.
96
+
97
+ Hard-fail when lastmod is missing entirely (means the preset wrap
98
+ didn't kick in). Pass when at least half of URLs have lastmod —
99
+ Docusaurus' auto-generated routes (/docs/category/X/, the root path
100
+ without a source file, redirects, etc.) legitimately don't have a
101
+ git mtime to use, so 100% coverage is unrealistic. ~80% is typical
102
+ for a content-heavy docs site. */
96
103
  check('sitemap.xml emits <lastmod> on URLs', () => {
97
104
  const body = readBuild('sitemap.xml');
98
105
  const locCount = (body.match(/<loc>/g) || []).length;
@@ -102,8 +109,8 @@ check('sitemap.xml emits <lastmod> on URLs', () => {
102
109
  return {ok: false, msg: `0 / ${locCount} URLs have <lastmod>. Upgrade to @conduction/docusaurus-preset ^3.7.0 or set sitemap.lastmod in docusaurus.config.`};
103
110
  }
104
111
  const ratio = lastmodCount / locCount;
105
- if (ratio < 0.9) {
106
- return {ok: false, msg: `only ${lastmodCount} / ${locCount} URLs have <lastmod>`};
112
+ if (ratio < 0.5) {
113
+ return {ok: false, msg: `only ${lastmodCount} / ${locCount} URLs have <lastmod> (under 50%); investigate which routes are missing source files`};
107
114
  }
108
115
  return {ok: true, msg: `${lastmodCount} / ${locCount} URLs (${Math.round(ratio * 100)}%)`};
109
116
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/docusaurus-preset",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "scripts": {
5
5
  "prepack": "node scripts/prepack-bundle-css.js"
6
6
  },