Featured image of post Hugo Command List

Hugo Command List

What is Hugo?

Hugo is a static site generator. It can convert Markdown files into HTML and create websites. Hugo is written in the Go language and runs very fast.

This blog is also created with Hugo.

Installing the Hugo CLI

To install the Hugo CLI, run the following command.

  • Example for macOS. For other operating systems, please refer to the official documentation.
1
brew install hugo

You can install it using Homebrew.

Hugo Command List

Hugo provides various commands. Below is a summary of commonly used commands.

Create a new site

1
hugo new site <site-name>

Command to create a new site. Specify the name of the site in <site-name>.

Create a new post

1
hugo new <post-name>.md

Command to create a new post. Specify the name of the post in <post-name>.

Start the server

1
hugo server

Command to start a local server. You can access it at http://localhost:1313.

Build the site

1
hugo

Command to build the site. HTML files will be generated in the public directory.

Deploy the site

1
hugo deploy

Command to deploy the site. Deployment settings are configured in the config.toml file.

List all posts

1
hugo list all

Command to display a list of all posts.

Check configuration

1
hugo config

Command to check the configuration.

Display help

1
hugo help

Command to display help information.

Display version

1
hugo version

Command to display the version.

That concludes the Hugo command list. There are many other commands available, so please refer to the official documentation for more details.

References

comments powered by Disqus