mirror of
https://github.com/gohugoio/hugo.git
synced 2025-05-05 18:10:18 +03:00
Merge commit '5e078383a7
'
This commit is contained in:
commit
ddc15ed41b
79 changed files with 6251 additions and 391 deletions
|
@ -7,13 +7,12 @@ menu:
|
|||
docs:
|
||||
parent: "functions"
|
||||
keywords: []
|
||||
signature: ["RESOURCE or STRING | transform.Unmarshal [OPTIONS]" ]
|
||||
signature: ["RESOURCE or STRING | transform.Unmarshal [OPTIONS]"]
|
||||
hugoversion: "0.53"
|
||||
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
|
||||
{{ $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:
|
||||
|
||||
delimiter
|
||||
: The delimiter used, default is `,`
|
||||
: The delimiter used, default is `,`.
|
||||
|
||||
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:
|
||||
|
||||
```go-html-template
|
||||
{{ $csv := "a;b;c" | transform.Unmarshal (dict "delimiter" ";") }}
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue