Skip to content

armgit / cogit

Public Imported from GitHub
0

Git for the intent behind agent-written code. Records what your coding agent decided and why, and links every commit to it.

fix(map): the diagram script is found relative to the page

Eren1e353001566d
diff --git a/packages/template/src/MermaidDiagram.tsx b/packages/template/src/MermaidDiagram.tsx
index 4a8df09..2c6b3d8 100644
--- a/packages/template/src/MermaidDiagram.tsx
+++ b/packages/template/src/MermaidDiagram.tsx
@@ -17,7 +17,10 @@ import { getTheme, subscribeTheme, type ThemeMode } from "./theme.js";
* no server, so it shows the diagram's source as text; a source the renderer
* refuses falls back to the text too.
*/
-export const MERMAID_URL = "/assets/mermaid.js";
+// Relative, not rooted: the local server serves it at /assets/mermaid.js, and a
+// page published under a subpath (the demo on GitHub Pages) finds it beside
+// itself in assets/mermaid.js.
+export const MERMAID_URL = "assets/mermaid.js";
interface Mermaid {
initialize(config: Record<string, unknown>): void;