diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-02-25 09:24:59 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-02-25 19:53:18 +0100 |
commit | ce524d0b5ebaef05d29fa368465f31358f26dcda (patch) | |
tree | e5df54a5deeefacbff4916d3619f85c2cb341b01 /hugolib/alias.go | |
parent | 2662faf61ff0240be1ee0d6c496b6b4a6ed55fb4 (diff) |
Add a page template func
Fixes #9339
Diffstat (limited to 'hugolib/alias.go')
-rw-r--r-- | hugolib/alias.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hugolib/alias.go b/hugolib/alias.go index 2609cd6bb..071f73d41 100644 --- a/hugolib/alias.go +++ b/hugolib/alias.go @@ -15,6 +15,7 @@ package hugolib import ( "bytes" + "context" "errors" "fmt" "io" @@ -64,8 +65,10 @@ func (a aliasHandler) renderAlias(permalink string, p page.Page) (io.Reader, err p, } + ctx := tpl.SetPageInContext(context.Background(), p) + buffer := new(bytes.Buffer) - err := a.t.Execute(templ, buffer, data) + err := a.t.ExecuteWithContext(ctx, templ, buffer, data) if err != nil { return nil, err } |