From: Bjørn Erik Pedersen Date: Sat, 20 May 2017 08:41:43 +0000 (+0300) Subject: tpl/time: Re-add the time example X-Git-Tag: v0.21~6 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a119ef693faf5dc346fec78ca8a18948ec65a993;p=brevno-suite%2Fhugo tpl/time: Re-add the time example --- diff --git a/docs/data/docs.json b/docs/data/docs.json index 852b110e..698130c8 100644 --- a/docs/data/docs.json +++ b/docs/data/docs.json @@ -1439,12 +1439,10 @@ "Args": [ "v" ], - "Aliases": [ - "asTime" - ], + "Aliases": null, "Examples": [ [ - "{{ (asTime \"2015-01-21\").Year }}", + "{{ (time \"2015-01-21\").Year }}", "2015" ] ] diff --git a/tpl/time/init.go b/tpl/time/init.go index 760986e5..d0c774a0 100644 --- a/tpl/time/init.go +++ b/tpl/time/init.go @@ -58,6 +58,13 @@ func init() { [][2]string{}, ) + ns.AddMethodMapping(ctx.AsTime, + nil, + [][2]string{ + {`{{ (time "2015-01-21").Year }}`, `2015`}, + }, + ) + return ns }