@hgdc/agents 0.1.1 → 0.1.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/dist/build.js +4 -2
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -75,10 +75,12 @@ export function markdownRoutes(pages, options) {
|
|
|
75
75
|
// Pages dont le fichier ne suit pas `<chemin>.md` (racine, préfixe) : une route chacune.
|
|
76
76
|
const special = pages.filter((p) => p.file !== `${p.path.slice(1)}.md`);
|
|
77
77
|
const regular = pages.filter((p) => p.file === `${p.path.slice(1)}.md`);
|
|
78
|
-
|
|
78
|
+
// L'accueil d'un préfixe arrive aussi avec la barre finale : `/agence/`, forme que relaie le site parent.
|
|
79
|
+
const pattern = (path) => (base && path === base ? `${escapeRegex(path)}/?` : escapeRegex(path));
|
|
80
|
+
for (const group of chunks(pages.map((p) => pattern(p.path))))
|
|
79
81
|
before.push({ src: `^(?:${group})$`, headers: { Vary: "Accept" }, continue: true });
|
|
80
82
|
for (const page of special) {
|
|
81
|
-
const src = `^${
|
|
83
|
+
const src = `^${pattern(page.path)}$`;
|
|
82
84
|
const link = canonical(page.path === "/" ? "/" : page.path);
|
|
83
85
|
before.push({
|
|
84
86
|
src,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hgdc/agents",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Sites lisibles par les agents IA : version Markdown des pages (Accept: text/markdown), 404 en Markdown, routes Build Output API pour les sites prérendus.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://github.com/hugogebel-boop/hgdc-kit/tree/main/packages/agents#readme",
|