Add a page template func

Fixes #9339
This commit is contained in:
Bjørn Erik Pedersen
2023-02-25 09:24:59 +01:00
parent 2662faf61f
commit ce524d0b5e
54 changed files with 436 additions and 108 deletions

View File

@@ -14,6 +14,8 @@
package js
import (
"context"
"github.com/gohugoio/hugo/deps"
"github.com/gohugoio/hugo/tpl/internal"
)
@@ -26,7 +28,7 @@ func init() {
ns := &internal.TemplateFuncsNamespace{
Name: name,
Context: func(args ...any) (any, error) { return ctx, nil },
Context: func(cctx context.Context, args ...any) (any, error) { return ctx, nil },
}
return ns