Found via a failing title assertion while doing the UI copy pass in #116.
parsePageTemplate parses the page file beforehtmlheader.html. That header contains {{block "title" .}}Webhooker{{end}}, which redefines the same template name and therefore wins. Every page's {{define "title"}} is dead: the browser tab reads "Webhooker" on every page regardless of what the page declares.
Consequence beyond cosmetics: any title copy is silently inert, so it cannot be relied on and a title assertion in one page's test would pass for the wrong reason.
Definition of done
Each page's {{define "title"}} renders in the browser tab, with htmlheader.html's block remaining the fallback for pages that declare none.
A rendering assertion per page template that the tab title matches that page, so the regression cannot return silently.
Implementation requirements
Expected fix is ordering: parse htmlheader.html ahead of the page file in parsePageTemplate's ParseFS arguments. Confirm that against html/template's actual redefinition semantics rather than assuming.
Branch from next, PR based on next, single commit, title ending (closes #N).
Touches internal/handlers/handlers.go and a test file. Do not take on unrelated copy changes.
Gate on make check plus script/cibuild with the Docker cache defeated.
Found via a failing title assertion while doing the UI copy pass in https://git.eeqj.de/sneak/webhooker/pulls/116.
`parsePageTemplate` parses the page file *before* `htmlheader.html`. That header contains `{{block "title" .}}Webhooker{{end}}`, which redefines the same template name and therefore wins. Every page's `{{define "title"}}` is dead: the browser tab reads "Webhooker" on every page regardless of what the page declares.
Consequence beyond cosmetics: any title copy is silently inert, so it cannot be relied on and a title assertion in one page's test would pass for the wrong reason.
## Definition of done
- Each page's `{{define "title"}}` renders in the browser tab, with `htmlheader.html`'s block remaining the fallback for pages that declare none.
- A rendering assertion per page template that the tab title matches that page, so the regression cannot return silently.
## Implementation requirements
- Expected fix is ordering: parse `htmlheader.html` ahead of the page file in `parsePageTemplate`'s `ParseFS` arguments. Confirm that against `html/template`'s actual redefinition semantics rather than assuming.
- Branch from `next`, PR based on `next`, single commit, title ending ` (closes #N)`.
- Touches `internal/handlers/handlers.go` and a test file. Do not take on unrelated copy changes.
- Gate on `make check` plus `script/cibuild` with the Docker cache defeated.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Found via a failing title assertion while doing the UI copy pass in #116.
parsePageTemplateparses the page file beforehtmlheader.html. That header contains{{block "title" .}}Webhooker{{end}}, which redefines the same template name and therefore wins. Every page's{{define "title"}}is dead: the browser tab reads "Webhooker" on every page regardless of what the page declares.Consequence beyond cosmetics: any title copy is silently inert, so it cannot be relied on and a title assertion in one page's test would pass for the wrong reason.
Definition of done
{{define "title"}}renders in the browser tab, withhtmlheader.html's block remaining the fallback for pages that declare none.Implementation requirements
htmlheader.htmlahead of the page file inparsePageTemplate'sParseFSarguments. Confirm that againsthtml/template's actual redefinition semantics rather than assuming.next, PR based onnext, single commit, title ending(closes #N).internal/handlers/handlers.goand a test file. Do not take on unrelated copy changes.make checkplusscript/cibuildwith the Docker cache defeated.