mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-15 02:17:05 +00:00
Update debug.Dump
This commit is contained in:
1 parent
38d6731e29
commit
3dcf32e25b
9 files changed
+24
-63
No files matched your search
@@ -11,33 +11,22 @@ action:
|
||||
---
|
||||
|
||||
```go-html-template
|
||||
{{ $data := dict }}
|
||||
{{ $p := "data/books.json" }}
|
||||
{{ with resources.Get $p }}
|
||||
{{ $opts := dict "delimiter" "," }}
|
||||
{{ $data = .Content | 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 %}}
|
||||
|
||||
Reference in new issue
Block a user