Clarify that .Now is obsolete

And fix typo: `now` should be without leading dot.

Fixes #470
This commit is contained in:
Anthony Fok
2018-05-03 00:32:49 -06:00
parent 879ea3f6a2
commit 09fa1bc4e8
+9 -3
View File
@@ -21,7 +21,7 @@ aliases: []
See [`time.Time`](https://godoc.org/time#Time).
For example, building your site on June 24, 2017 with the following templating:
For example, building your site on June 24, 2017, with the following templating:
```
<div>
@@ -29,7 +29,7 @@ For example, building your site on June 24, 2017 with the following templating:
</div>
```
Which will produce the following:
would produce the following:
```
<div>
@@ -40,5 +40,11 @@ Which will produce the following:
The above example uses the [`.Format` function](/functions/format), which page includes a full listing of date formatting using Golang's layout string.
{{% note %}}
Older Hugo themes may use the deprecated `.Now` (uppercase). Be sure to use the lowercase `.now` in your templating.
Older Hugo themes may still be using the obsolete Pages `.Now` (uppercase with leading dot), which causes build error that looks like the following:
ERROR ... Error while rendering "..." in "...": ...
executing "..." at <.Now.Format>:
can't evaluate field Now in type *hugolib.PageOutput
Be sure to use `now` (lowercase with _**no**_ leading dot) in your templating.
{{% /note %}}