mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-18 11:24:39 -04:00
Update transform.Unmarshal.md
Fix some typos.
This commit is contained in:
parent
785e375f57
commit
71c0826f3c
@ -12,8 +12,7 @@ hugoversion: "0.53"
|
|||||||
aliases: []
|
aliases: []
|
||||||
---
|
---
|
||||||
|
|
||||||
|
The function accept either a `Resource` created in [Hugo Pipes](/hugo-pipes/) or via [Page Bundles](/content-management/page-bundles/), or simply a string. The two examples below will produce the same map:
|
||||||
The function accept either a `Resource` created in [Hugo Pipes](/hugo-pipes/) or via [Page Bundles](content-management/page-bundles/), or simply a string. The two examples below will produce the same map:
|
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ $greetings := "hello = \"Hello Hugo\"" | transform.Unmarshal }}`
|
{{ $greetings := "hello = \"Hello Hugo\"" | transform.Unmarshal }}`
|
||||||
@ -36,15 +35,13 @@ The above prints `Hello Hugo`.
|
|||||||
Unmarshal with CSV as input has some options you can set:
|
Unmarshal with CSV as input has some options you can set:
|
||||||
|
|
||||||
delimiter
|
delimiter
|
||||||
: The delimiter used, default is `,`
|
: The delimiter used, default is `,`.
|
||||||
|
|
||||||
comment
|
comment
|
||||||
: The comment character ued in the CSV. If set, lines beginning with the comment character without preceding whitespace are ignored.:
|
: The comment character used in the CSV. If set, lines beginning with the comment character without preceding whitespace are ignored.:
|
||||||
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ $csv := "a;b;c" | transform.Unmarshal (dict "delimiter" ";") }}
|
{{ $csv := "a;b;c" | transform.Unmarshal (dict "delimiter" ";") }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user