gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
75.36k stars 7.49k forks source link

`hugo new -f yaml` fails in v0.24 #3631

Closed yihui closed 7 years ago

yihui commented 7 years ago

It used to work before 0.23, and the doc says -f is supported: http://gohugo.io/commands/hugo_new/

$ hugo new foo.md -f yaml
Error: unknown shorthand flag: 'f' in -f

Usage:
  hugo new [path] [flags]
  hugo new [command]

Available Commands:
  site        Create a new site (skeleton)
  theme       Create a new theme

Flags:
      --editor string   edit new content with this editor, if provided
  -h, --help            help for new
  -k, --kind string     content type to create
  -s, --source string   filesystem path to read files relative from

Global Flags:
      --config string    config file (default is path/config.yaml|json|toml)
      --log              enable Logging
      --logFile string   log File path (if set, logging enabled automatically)
      --quiet            build in quiet mode
  -v, --verbose          verbose output
      --verboseLog       verbose logging

Use "hugo new [command] --help" for more information about a command.

$ hugo version
Hugo Static Site Generator v0.24 darwin/amd64 BuildDate: 2017-06-22T14:13:34-05:00
bep commented 7 years ago

I have updated the docs and the release notes: That flag is removed as it has no practical appliance anymore; we use the archetype files as you write them -- and all front matter formats are supported.

yihui commented 7 years ago

The conversion to YAML was actually useful to me because YAML is best supported in my world (R language). I will need to work much harder to support TOML. Is it hard to keep this argument? Thanks!

bep commented 7 years ago

Is it hard to keep this argument? Thanks!

It will not happen. If you want YAML: Create your archetype file(s) with YAML format. Easy.

yihui commented 7 years ago

Yeah I know that. The problem is this: a theme author may have provided a TOML-based (or JSON) archetype file, but the user does not have one. In this case, hugo new will generate the metadata in TOML, and I wish it could convert it to YAML instead.

If hugo convert toYAML can work on a single file instead of a whole directory, that will help, too.

I can certainly ask users to create a YAML-based archetype file, but it will be better if fewer instructions are needed.

bep commented 7 years ago

If hugo convert toYAML can work on a single file instead of a whole directory, that will help, too.

That we can do, but you would have to create an issue for that.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.