# 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 4 content files'
grep '^{' myjsoncontent/content/mytoml.md
grep '^{' myjsoncontent/content/myjson.md
grep '^{' myjsoncontent/content/myyaml.md
grep '^{' myjsoncontent/content/bundle/index.md
exists myjsoncontent/content/bundle/data.txt
exists myjsoncontent/content/bundle/nested/asset.dat
hugo convert toYAML -o myyamlcontent
stdout 'processing 4 content files'
exists myyamlcontent/content/bundle/data.txt
exists myyamlcontent/content/bundle/nested/asset.dat
hugo convert toTOML -o mytomlcontent
stdout 'processing 4 content files'
exists mytomlcontent/content/bundle/data.txt
exists mytomlcontent/content/bundle/nested/asset.dat





-- 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
-- content/bundle/index.md --
---
title: Bundle
---
Bundle content
-- content/bundle/data.txt --
bundle resource
-- content/bundle/nested/asset.dat --
nested resource
