1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

doc: Merge commit '2c0d1ccdcd95de0bddeb39dca2e4d08f0d8056d7'

This commit is contained in:
Bjørn Erik Pedersen
2017-07-21 11:00:08 +02:00
146 changed files with 1037 additions and 1443 deletions

View File

@@ -23,11 +23,9 @@ aliases: []
This very simple one-liner uses `now.Unix` to calculate the amount of time that has passed between the `.LastMod` for the current page and the last build of the current page.
{{% code file="time-passed.html" %}}
```golang
{{< code file="time-passed.html" >}}
{{ div (sub now.Unix .Lastmod.Unix) 86400 }}
```
{{% /code %}}
{{< /code >}}
Since both values are integers, they can be subtracted and then divided by the number of seconds in a day (i.e., `60 * 60 * 24 == 86400`).