diff --git a/github-pages/scripts/generate-content.mjs b/github-pages/scripts/generate-content.mjs index cd3d0e85..5435be7a 100644 --- a/github-pages/scripts/generate-content.mjs +++ b/github-pages/scripts/generate-content.mjs @@ -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, }); diff --git a/github-pages/tests/generated-content.test.mjs b/github-pages/tests/generated-content.test.mjs index 29297c4c..5591eed0 100644 --- a/github-pages/tests/generated-content.test.mjs +++ b/github-pages/tests/generated-content.test.mjs @@ -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");