Improve bundled Hugo command-line interface
Summary
The current Hugo integration is very rudimentary. Especially as:
-
It requires you to be in the Hugo directory (e.g.,
.hugo
) (as opposed to anywhere within your project directory) to carry out Hugo commands. While you can have more than one Hugo route on a site, we can support the default/99% use case of having just one and it being the root with a more streamlined interface. -
The command to create a new Hugo project is convoluted/repetitive for the default case (
site hugo new site .hugo
).
Proposed solution
-
Unless person is already in a folder that begins with
.hugo
, normalise the current working directory to the.hugo
directory at the base directory of the site. If one does not exist, display an appropriate error and exit. -
Add a
site hugo init
command that initialises default Hugo support (at.hugo/
in the root of the site).