Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tpl/time
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-05-20 11:41:43 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-05-20 11:41:43 +0300
commita119ef693faf5dc346fec78ca8a18948ec65a993 (patch)
tree35b78da83dabee9f69a4eb2edd298612c16de078 /tpl/time
parent1f9e8dcc6010abeea8abc7ba1a092c4dab9852f6 (diff)
tpl/time: Re-add the time example
Diffstat (limited to 'tpl/time')
-rw-r--r--tpl/time/init.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/tpl/time/init.go b/tpl/time/init.go
index 760986e5a..d0c774a0f 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
}