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,7 @@
package time
import (
"context"
"errors"
"github.com/gohugoio/hugo/deps"
@@ -32,7 +33,7 @@ func init() {
ns := &internal.TemplateFuncsNamespace{
Name: name,
Context: func(args ...any) (any, error) {
Context: func(cctx context.Context, args ...any) (any, error) {
// Handle overlapping "time" namespace and func.
//
// If no args are passed to `time`, assume namespace usage and