mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-23 11:31:03 +00:00
6b5e117a12
Closes #12897 Change-Id: Ib27a4a7b540d45243e6252db769d4b9fb7447718 Signed-off-by: Rohan Hasabe <rohanhasabe8@gmail.com>
42 lines
864 B
Text
42 lines
864 B
Text
# Test the convert commands.
|
|
|
|
hugo convert -h
|
|
stdout 'Convert front matter to another format'
|
|
hugo convert toJSON -h
|
|
stdout 'to use JSON for the front matter'
|
|
hugo convert toTOML -h
|
|
stdout 'to use TOML for the front matter'
|
|
hugo convert toYAML -h
|
|
stdout 'to use YAML for the front matter'
|
|
|
|
hugo convert toJSON -o myjsoncontent
|
|
stdout 'processing 3 content files'
|
|
grep '^{' myjsoncontent/content/mytoml.md
|
|
grep '^{' myjsoncontent/content/myjson.md
|
|
grep '^{' myjsoncontent/content/myyaml.md
|
|
hugo convert toYAML -o myyamlcontent
|
|
stdout 'processing 3 content files'
|
|
hugo convert toTOML -o mytomlcontent
|
|
stdout 'processing 3 content files'
|
|
|
|
|
|
|
|
|
|
|
|
-- hugo.toml --
|
|
baseURL = "http://example.org/"
|
|
-- content/mytoml.md --
|
|
+++
|
|
title = "TOML"
|
|
+++
|
|
TOML content
|
|
-- content/myjson.md --
|
|
{
|
|
"title": "JSON"
|
|
}
|
|
JSON content
|
|
-- content/myyaml.md --
|
|
---
|
|
title: YAML
|
|
---
|
|
YAML content
|