mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-26 08:18:53 +00:00
Clarify that .Now is obsolete
And fix typo: `now` should be without leading dot. Fixes #470
This commit is contained in:
@@ -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 Page’s `.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 %}}
|
||||
|
||||
Reference in New Issue
Block a user