Wire the error page and the hub directory into main, and re-pin estilo
cmd/docs/main.go sets rastrillo.Options.ErrorPage to App.ErrorPage, so a panic outside the router's signed-in group still gets the error page, and reads HOME_DIRECTORY_ORIGIN (Home's own variable) for the switcher's All apps. estilo moves to 5b397d9 (menu panels sized to their rows). gofmt on two files the previous commit left unformatted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 files changed,
+11
−4
cmd/docs/main.go+6 −0go.mod+1 −1go.sum+2 −2internal/docs/home_router_integration_test.go+1 −0internal/docs/render.go+1 −1
diff --git a/cmd/docs/main.go b/cmd/docs/main.go| index e640273..f040af6 100644 |
| --- a/cmd/docs/main.go |
| +++ b/cmd/docs/main.go |
| @@ -279,6 +279,9 @@ func main() { |
| AllowedAddresses: allowedAddresses, |
| SampleDocuments: sampleDocuments, |
| Logger: logger, |
| + // The hub directory the app switcher's "All apps" goes to. The |
| + // same variable Home itself reads (home origins.go). |
| + Directory: os.Getenv("HOME_DIRECTORY_ORIGIN"), |
| } |
| home := docs.HomeConfig{Issuer: os.Getenv("DOCS_HOME_ISSUER"), ConsumerID: os.Getenv("DOCS_HOME_CONSUMER_ID"), KeysBase64: os.Getenv("DOCS_HOME_KEYS_BASE64"), DEKBase64: os.Getenv("DOCS_HOME_DEK_BASE64")} |
| if home.Issuer != "" || home.ConsumerID != "" || home.KeysBase64 != "" || home.DEKBase64 != "" { |
| @@ -332,6 +335,9 @@ func main() { |
| } |
| opts.Mux = app.Handler() |
| + // A panic outside the router's signed-in group (which has its own |
| + // recoverer) still gets the error page rather than plain text. |
| + opts.ErrorPage = app.ErrorPage |
| opts.DBPath = "" |
| opts.Locales = docs.Locales |
| opts.DefaultLocale = docs.DefaultLocale |
diff --git a/go.mod b/go.mod| index edcd2b7..c6cede7 100644 |
| --- a/go.mod |
| +++ b/go.mod |
| @@ -3,7 +3,7 @@ module github.com/carlosframework/docs |
| go 1.26.5 |
| require ( |
| - amadan.net/oficina/estilo.git v0.0.0-20260923174322-485d60371724 |
| + amadan.net/oficina/estilo.git v0.0.0-20260923182543-5b397d9c09df |
| amadan.net/oficina/home/handoff v0.0.0-20260908102137-481d2d57f489 |
| amadan.net/oficina/home/roster v0.0.0-20260908123429-74dda570e0cf |
| amadan.net/rastrillo/native/server v0.0.0-20260912204600-33ffe9941734 |
diff --git a/go.sum b/go.sum| index 4a3e4cf..93b0895 100644 |
| --- a/go.sum |
| +++ b/go.sum |
| @@ -1,5 +1,5 @@ |
| -amadan.net/oficina/estilo.git v0.0.0-20260923174322-485d60371724 h1:TdmrJbz3LCJqDwT71+n3G4yRORLcgABzERkMMakwQ2Q= |
| -amadan.net/oficina/estilo.git v0.0.0-20260923174322-485d60371724/go.mod h1:4u0jNBtIdMLOsJyrScfqoEuYDJF7BBM3qM9YWbzt6aw= |
| +amadan.net/oficina/estilo.git v0.0.0-20260923182543-5b397d9c09df h1:N7l6YbG1T37Q1IJKwE92EG/B5zVH/deACQ+FSlXILR8= |
| +amadan.net/oficina/estilo.git v0.0.0-20260923182543-5b397d9c09df/go.mod h1:4u0jNBtIdMLOsJyrScfqoEuYDJF7BBM3qM9YWbzt6aw= |
| amadan.net/oficina/home/handoff v0.0.0-20260908102137-481d2d57f489 h1:RPKtyry/71i06o8L+gjAaUyexbmG56kO1YPs601URAM= |
| amadan.net/oficina/home/handoff v0.0.0-20260908102137-481d2d57f489/go.mod h1:YISpzFJ+iMgrM0rUL032OSzsAQbP4/nozvXLCCOcn1k= |
| amadan.net/oficina/home/roster v0.0.0-20260908123429-74dda570e0cf h1:SRKjCUgtk42WwR7VSn+V0eLNk20mfiY8dQmzdw13Sbo= |
diff --git a/internal/docs/home_router_integration_test.go b/internal/docs/home_router_integration_test.go| index 971967b..3d8fb31 100644 |
| --- a/internal/docs/home_router_integration_test.go |
| +++ b/internal/docs/home_router_integration_test.go |
| @@ -115,6 +115,7 @@ func (b *routerBrowser) localLink(t *testing.T, address string) string { |
| } |
| return path |
| } |
| + |
| // localSignin completes a local email sign-in. It lands on the list, or |
| // on landing when the browser was sent to sign in from a page (spec |
| // §9.4: the remembered return path, not "/"). |
diff --git a/internal/docs/render.go b/internal/docs/render.go| index a1a87fa..5440373 100644 |
| --- a/internal/docs/render.go |
| +++ b/internal/docs/render.go |
| @@ -409,7 +409,7 @@ var Catalog = rastrillo.Catalog{ |
| "docs.editor.menu.format": "Format", |
| "docs.editor.menu.tools": "Tools", |
| - "docs.editor.menu.file.new": "New document", |
| + "docs.editor.menu.file.new": "New document", |
| // The ellipsis (U+2026) marks an item that needs more before anything |
| // happens: a palette, a dialog (spec §7.3). An item that simply does |
| // its thing, or navigates, has none. |