Given that Hugo recently processes archetype as template files (since version 0.24), I’m trying to update my archetypes. One change I want to make is pre-fill the dates in the right format, like so:
date = "{{ dateFormat .Date "2-1-2006" }}"
Which Hugo doesn’t like:
executing “hugo” at <dateFormat .Date "2-…>: error calling dateFormat: unable to parse date: 2-1-2006
Using .Format
neither works:
date = "{{ .Date.Format "2-1-2006" }}"
executing “hugo” at <.Date.Format>: can’t evaluate field Format in type string
Am I missing something, or is this simply not possible?
PS:
- I have no trouble executing the
replace
function in my archetype file. - Escaping the inner double-quotes with
\
doesn’t help.
Hugo Static Site Generator v0.30.2 windows/amd64 BuildDate: 2017-10-20T12:44:44+02:00
GOOS="windows"
GOARCH="amd64"
GOVERSION="go1.9.1"