test(docs): include Mattermost in static build contracts

This commit is contained in:
dadachann
2026-09-09 02:43:56 +00:00
parent ef9154d982
commit 12b55322a9
4 changed files with 30 additions and 5 deletions
+21
View File
@@ -2730,6 +2730,27 @@
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/usage/platforms/line" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/usage/platforms/line" />
</url>
<url>
<loc>https://langbot.app/docs/en/usage/platforms/mattermost</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/usage/platforms/mattermost" />
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://langbot.app/docs/zh/usage/platforms/mattermost" />
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/usage/platforms/mattermost" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/usage/platforms/mattermost" />
</url>
<url>
<loc>https://langbot.app/docs/zh/usage/platforms/mattermost</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/usage/platforms/mattermost" />
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://langbot.app/docs/zh/usage/platforms/mattermost" />
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/usage/platforms/mattermost" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/usage/platforms/mattermost" />
</url>
<url>
<loc>https://langbot.app/docs/ja/usage/platforms/mattermost</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/usage/platforms/mattermost" />
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://langbot.app/docs/zh/usage/platforms/mattermost" />
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/usage/platforms/mattermost" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/usage/platforms/mattermost" />
</url>
<url>
<loc>https://langbot.app/docs/en/usage/platforms/qq/aiocqhttp/lagrange</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/usage/platforms/qq/aiocqhttp/lagrange" />
+1 -1
View File
@@ -22,7 +22,7 @@ function links(node, result = []) {
}
test("every sitemap page has meaningful canonical Markdown and HTML discovery", async () => {
assert.equal(urls.length, 479);
assert.equal(urls.length, 482);
for (const url of urls) {
const route = relative(url);
const text = await read(`${route}.md`);
+6 -2
View File
@@ -43,9 +43,9 @@ function staticHtmlForUrlPath(urlPath) {
return path.join(publicRoot, ...parts, "index.html");
}
test("all 302 canonical localized documents have static HTML", async () => {
test("all 305 canonical localized documents have static HTML", async () => {
const documents = await collectMdxDocuments(root);
assert.equal(documents.length, 302);
assert.equal(documents.length, 305);
const missing = [];
for (const document of documents) {
try {
@@ -199,6 +199,10 @@ test("canonical sitemap routes match the legacy Mintlify directory structure", a
// Mintlify accidentally indexed this repository maintenance note; preserve
// its URL as a redirect without treating it as public documentation.
legacy.delete("/scripts/README-blog-articles");
// New guides added after migration extend, rather than replace, the legacy routes.
for (const locale of ["en", "zh", "ja"]) {
legacy.add(`/${locale}/usage/platforms/mattermost`);
}
const sitemap = await readFile(path.join(publicRoot, "sitemap.xml"), "utf8");
const actual = new Set([...sitemap.matchAll(/<loc>https:\/\/langbot\.app\/docs(\/[^<]+)<\/loc>/g)]
.map((match) => decodeURIComponent(match[1]).replace(/\/$/, "")));
+2 -2
View File
@@ -35,6 +35,6 @@ test("every localized HTML payload includes the preference client provider", asy
}
}
for (const locale of ["en", "zh", "ja"]) await visit(path.join(root, locale));
// 479 canonical content pages plus one framework 404 page per locale.
assert.equal(count, 482);
// 482 canonical content pages plus one framework 404 page per locale.
assert.equal(count, 485);
});