mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-29 15:10:35 +03:00
Merge commit '8b9803425e
'
This commit is contained in:
commit
af0cb57aaf
475 changed files with 7408 additions and 4720 deletions
|
@ -11,33 +11,22 @@ action:
|
|||
---
|
||||
|
||||
```go-html-template
|
||||
{{ $data := "" }}
|
||||
{{ $p := "data/books.json" }}
|
||||
{{ with resources.Get $p }}
|
||||
{{ $opts := dict "delimiter" "," }}
|
||||
{{ $data = . | transform.Unmarshal $opts }}
|
||||
{{ else }}
|
||||
{{ errorf "Unable to get resource %q" $p }}
|
||||
{{ end }}
|
||||
<pre>{{ debug.Dump site.Data.books }}</pre>
|
||||
```
|
||||
|
||||
```go-html-template
|
||||
<pre>{{ debug.Dump $data }}</pre>
|
||||
```
|
||||
|
||||
```text
|
||||
[]interface {}{
|
||||
map[string]interface {}{
|
||||
```json
|
||||
[
|
||||
{
|
||||
"author": "Victor Hugo",
|
||||
"rating": 5.0,
|
||||
"title": "Les Misérables",
|
||||
"rating": 4,
|
||||
"title": "The Hunchback of Notre Dame"
|
||||
},
|
||||
map[string]interface {}{
|
||||
{
|
||||
"author": "Victor Hugo",
|
||||
"rating": 4.0,
|
||||
"title": "The Hunchback of Notre Dame",
|
||||
},
|
||||
}
|
||||
"rating": 5,
|
||||
"title": "Les Misérables"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
|
|
|
@ -33,5 +33,5 @@ hugo --logLevel info
|
|||
The results are displayed in the console at the end of the build. You can have as many timers as you want and if you don't stop them, they will be stopped at the end of build.
|
||||
|
||||
```text
|
||||
INFO timer: name TestSqrt total 12.429355ms
|
||||
INFO timer: name TestSqrt count 1002 duration 2.496017496s average 2.491035ms median 2.282291ms
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue