fix(docs): publish OpenClaw and Hermes integration figures

The generated /en/integrations/openclaw, /zh/integrations/openclaw and
/en/integrations/hermes pages are built from the plugin READMEs, which
reference local figures/. Only the dsh and Studio READMEs had their
./figures/ links rewritten to site paths and their figure directories
copied into the build, so every screenshot on those three pages resolved
to /<language>/integrations/figures/*.png and 404'd. verify-build.mjs
only checks <a> links, never <img> sources, so the build stayed green.

Mirror the dsh pattern: rewrite the figure links to /figures/openclaw/
and /figures/hermes/, copy both figure directories into public/figures/,
add the missing language-cross link for the Hermes page, and cover all of
it in the generated-content tests.
This commit is contained in:
Ziyang Guo 2026-10-01 01:21:19 +08:00
parent dc12798526
commit f46e301938
2 changed files with 46 additions and 0 deletions

View file

@ -60,9 +60,15 @@ const externalDocumentRewrites = {
],
"integrations/openclaw/README.md": [
["(./README_ZH.md)", "(/zh/integrations/openclaw)"],
["(./figures/", "(/figures/openclaw/"],
],
"integrations/openclaw/README_ZH.md": [
["(./README.md)", "(/en/integrations/openclaw)"],
["(./figures/", "(/figures/openclaw/"],
],
"integrations/hermes_agent/README.md": [
["(README_ZH.md)", "(/zh/integrations/hermes)"],
["(figures/", "(/figures/hermes/"],
],
"reme_studio/README.md": [
["(./README_ZH.md)", "(/zh/workspace/studio)"],
@ -235,6 +241,12 @@ for (const [destination, source] of externalDocuments) {
await cp(path.join(repoDir, "integrations/dsh/figures"), path.join(outputDir, "public/figures/dsh"), {
recursive: true,
});
await cp(path.join(repoDir, "integrations/openclaw/figures"), path.join(outputDir, "public/figures/openclaw"), {
recursive: true,
});
await cp(path.join(repoDir, "integrations/hermes_agent/figures"), path.join(outputDir, "public/figures/hermes"), {
recursive: true,
});
await cp(path.join(repoDir, "reme_studio/figures"), path.join(outputDir, "public/figures/studio"), {
recursive: true,
});

View file

@ -89,6 +89,40 @@ test("publishes Studio screenshots with site-safe links", async () => {
assert.match(chinese, /\(\/en\/workspace\/studio\)/);
});
test("publishes OpenClaw and Hermes integration figures with site-safe links", async () => {
const openclawEnglish = await readFile(path.join(generatedDir, "en/integrations/openclaw.md"), "utf8");
const openclawChinese = await readFile(path.join(generatedDir, "zh/integrations/openclaw.md"), "utf8");
for (const page of [openclawEnglish, openclawChinese]) {
assert.match(page, /\(\/figures\/openclaw\/status-overview\.png\)/);
assert.doesNotMatch(page, /\]\(\.\/figures\//);
}
for (const name of [
"status-overview.png",
"plugin-installed.png",
"plugin-configuration.png",
"memory-search.png",
"auto-dream.png",
"automatic-recall.png",
"conversation-memory.png",
]) {
await access(path.join(generatedDir, "public/figures/openclaw", name));
}
const hermesEnglish = await readFile(path.join(generatedDir, "en/integrations/hermes.md"), "utf8");
assert.match(hermesEnglish, /\(\/figures\/hermes\/hermes-provider-settings\.png\)/);
assert.match(hermesEnglish, /\(\/zh\/integrations\/hermes\)/);
assert.doesNotMatch(hermesEnglish, /\]\(figures\//);
for (const name of [
"hermes-provider-settings.png",
"hermes-http-sessions.png",
"hermes-http-recall.png",
"hermes-reme-daily-note.png",
"hermes-embedded-recall.png",
]) {
await access(path.join(generatedDir, "public/figures/hermes", name));
}
});
test("keeps Studio source READMEs portable for package registries", async () => {
for (const name of ["README.md", "README_ZH.md"]) {
const source = await readFile(path.join(repoDir, "reme_studio", name), "utf8");