mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
docs: Regen docshelper
This commit is contained in:
@@ -170,14 +170,17 @@ func (namespaces TemplateFuncsNamespaces) MarshalJSON() ([]byte, error) {
|
||||
buf.WriteString("{")
|
||||
|
||||
for i, ns := range namespaces {
|
||||
if i != 0 {
|
||||
buf.WriteString(",")
|
||||
}
|
||||
|
||||
b, err := ns.toJSON(context.TODO())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
buf.Write(b)
|
||||
if b != nil {
|
||||
if i != 0 {
|
||||
buf.WriteString(",")
|
||||
}
|
||||
buf.Write(b)
|
||||
}
|
||||
}
|
||||
|
||||
buf.WriteString("}")
|
||||
@@ -202,6 +205,11 @@ func (t *TemplateFuncsNamespace) toJSON(ctx context.Context) ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tctx == nil {
|
||||
// E.g. page.
|
||||
// We should fix this, but we're going to abandon this construct in a little while.
|
||||
return nil, nil
|
||||
}
|
||||
ctxType := reflect.TypeOf(tctx)
|
||||
for i := 0; i < ctxType.NumMethod(); i++ {
|
||||
method := ctxType.Method(i)
|
||||
|
Reference in New Issue
Block a user