I found the documentation at https://gohugo.io/ to be lacking when it comes to starting a Hugo site from scratch.
There wasn’t much information in the Getting Started section, so I figured I would cover what I do to create a new Hugo site.
The first thing I do is navigate to the directory I’m going to create my Hugo project in. For this tutorial, I’ll use a directory called
mkdir medium && cd medium
Now that I’m in my new directory, I’ll check to see if Hugo is installed. If not, run the installation command.
brew install hugo
Create a new project
Now that Hugo is installed, let’s create a new project.
hugo new site .
This command tells Hugo to create a new site in the current directory.
You can list the directory to see what was created.
archetypes content layouts static
config.toml data public themes
Use a theme
Let’s add a theme. If you don’t know what you want, browse through https://themes.gohugo.io/ to find one close to what you want.
In the following example, I used the whisper theme.
hugo new theme <your_theme>
hugo new theme hugo-whisper-theme
themes directory was added.
archetypes content layouts resources themes
config.toml data public static
Let’s add new content in a folder called
hugo new docs/_index.md
Content "content/docs/_index.md" created
Go to your newly created file and add some markdown.
localhost:1313 in your browser.
You should now see your text in the browser.