mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Create a struct with all of Hugo's config options
Primary motivation is documentation, but it will also hopefully simplify the code. Also, * Lower case the default output format names; this is in line with the custom ones (map keys) and how it's treated all the places. This avoids doing `stringds.EqualFold` everywhere. Closes #10896 Closes #10620
This commit is contained in:
42
testscripts/commands/convert.txt
Normal file
42
testscripts/commands/convert.txt
Normal file
@@ -0,0 +1,42 @@
|
||||
# Test the convert commands.
|
||||
|
||||
hugo convert -h
|
||||
stdout 'Convert your content'
|
||||
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
|
Reference in New Issue
Block a user