Hugo new vs hugo new content

From this comment

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.

Does it mean the correct command is hugo new content posts/foo/index.md rather than hugo new posts/foo/index.md? I use the latter since I find the former having content in it redundant.

yes. if it goes that way

remember there are also:

  • hugo new site
  • hugo new theme

so the second argument is the type to create. which makes hugo new content a cleaner syntax than without.

and omittable defaults usually come at the end while this content is in the middle

also easier to parse than "if the second parameter is not site or … then it seems you want to create content.

Interesting…I always thougt the addition of content in the command was odd, but turns out it is the default. It will take a while getting used to it.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.