@@ -95,11 +95,11 @@ type Options struct { HeadPre, HeadPost template.HTML BodyPre string // An html/template definition of "body-pre" template. // BodyTop provides components to include on top of <body> of page rendered for req. It can be nil. BodyTop func(req *http.Request) ([]htmlg.Component, error) BodyTop func(*http.Request, common.State) ([]htmlg.Component, error) } // handler handles all requests to changesapp. It acts like a request multiplexer, // choosing from various endpoints and parsing the repository ID from URL. type handler struct { @@ -509,11 +509,11 @@ func (h *handler) state(req *http.Request, changeID uint64) (state, error) { }, } b.HeadPre = h.HeadPre b.HeadPost = h.HeadPost if h.BodyTop != nil { c, err := h.BodyTop(req) c, err := h.BodyTop(req, b.State) if err != nil { return state{}, err } var buf bytes.Buffer err = htmlg.RenderComponents(&buf, c...)