gohugoio / hugo

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

Deprecate hugo new (need to use hugo new content etc.) #11169

Open deining opened 1 year ago

deining commented 1 year ago

Hugo command new --help prints out 9 flags:

$ hugo new --help
Create a new content file and automatically set the date and title.
...

Usage:
  hugo new content [path] [flags]

Flags:
  -b, --baseURL string      hostname (and path) to the root, e.g. https://spf13.com/
      --cacheDir string     filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache_$USER/
  -c, --contentDir string   filesystem path to content directory
      --editor string       edit new content with this editor, if provided
  -f, --force               overwrite file if it already exists
      --format string       preferred file format (toml, yaml or json) (default "toml")
  -h, --help                help for content
  -k, --kind string         content type to create
  -t, --theme strings       themes to use (located in /themes/THEMENAME/)

Global Flags:
...

The documentation for command hugo new lists option --help only. This needs to be corrected.

Note: The documentation for command hugo new content correctly lists 9 options.

bep commented 1 year ago

This is the one command I talk about here:

https://github.com/bep/simplecobra#differences-to-cobra

hugo new only work because of backward compability (we just append content to the argument list), the correct command to use is hugo new content.

We will eventually add a warning on hugo new.