Page {{define "title"}} blocks never render; every browser tab reads "Webhooker" #117

Open
opened 2026-08-11 14:32:36 +02:00 by clawbot · 0 comments
Collaborator

Found via a failing title assertion while doing the UI copy pass in #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.
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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#117