From 1c24cfc652ff12b7d2f79b4dfce9c04cc470c5f9 Mon Sep 17 00:00:00 2001 From: Gianni Crivello Date: Fri, 13 Feb 2026 13:39:22 -0500 Subject: [PATCH] fix: set Gollum base_path and init git with main branch Two issues prevented the wiki from working on provisioned VMs: 1. Gollum generated all links (CSS, JS, /gollum/* pages) relative to root, but Caddy mounts it at /wiki. Adding base_path: 'wiki' to the config makes Gollum prefix all URLs correctly. 2. git init creates a 'master' branch by default on some systems, but Gollum is started with --ref main. Using git init -b main ensures the branch always matches. Co-Authored-By: Claude Opus 4.6 --- src/cli/agents/gollum.test.ts | 1 + src/cli/agents/gollum.ts | 1 + src/cli/handlers/install.ts | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cli/agents/gollum.test.ts b/src/cli/agents/gollum.test.ts index 8aa67c9..a00b194 100644 --- a/src/cli/agents/gollum.test.ts +++ b/src/cli/agents/gollum.test.ts @@ -42,6 +42,7 @@ test("generateGollumConfig returns valid ruby config", () => { expect(config).toContain("Precious::App.set(:wiki_options"); expect(config).toContain("index_page: 'README'"); expect(config).toContain("h1_title: true"); + expect(config).toContain("base_path: 'wiki'"); }); // --- startGollumServer --- diff --git a/src/cli/agents/gollum.ts b/src/cli/agents/gollum.ts index ae45256..1bdcd09 100644 --- a/src/cli/agents/gollum.ts +++ b/src/cli/agents/gollum.ts @@ -58,6 +58,7 @@ export function generateGollumConfig(): string { Precious::App.set(:wiki_options, { index_page: 'README', h1_title: true, + base_path: 'wiki', }) `; } diff --git a/src/cli/handlers/install.ts b/src/cli/handlers/install.ts index eff7704..500e188 100644 --- a/src/cli/handlers/install.ts +++ b/src/cli/handlers/install.ts @@ -40,7 +40,7 @@ export async function createWorkspace(prefix: string): Promise { // Init git repo and commit all scaffold files so they're tracked. // This prevents "untracked working tree files would be overwritten" // errors when merging task branches back into main. - await Bun.spawn(["git", "init"], { cwd: workspacePath, stdout: "pipe", stderr: "pipe" }).exited; + await Bun.spawn(["git", "init", "-b", "main"], { cwd: workspacePath, stdout: "pipe", stderr: "pipe" }).exited; await Bun.spawn(["git", "add", "-A"], { cwd: workspacePath, stdout: "pipe", stderr: "pipe" }).exited; await Bun.spawn(["git", "commit", "-m", "initial"], { cwd: workspacePath, stdout: "pipe", stderr: "pipe" }).exited;