Björn's world
November 30, 2021

First steps with Hugo

Posted on November 30, 2021  •  1 minutes  • 132 words  • Other languages:  Deutsch
Table of contents

1. Install Hugo

Hugo is actually just a binary that has to be downloaded and unpacked. More details are written here .

Then check:

hugo version

2. Create ne project

hugo new site new-project

generates the project folder “new-project” in current working directory.

3. Add theme as git submodule

cd new-project
git clone https://github.com/apvarun/blist-hugo-theme.git themes/blist

4. Configure

Copy and edit config.toml and package.json from blist-theme example

cp themes/blist/exampleSite/config.toml .
cp themes/blist/package.json .

Adapt paths in scripts-section (package.json):

  "scripts": {
    "start": "hugo --gc",
    "dev": "hugo server --disableFastRender",
    "build": "NODE_ENV=production hugo --gc"
  },

5. Add content directories

cp themes/blist/exampleSite/content .

6. Add additional languages

Copy and edit a language section within config.toml (e.g. [languages.en]).

Create directories for new language:

mkdir -p content/es/blog
mkdir -p content/es/page

6. Generate new post

hugo new content/de/blog/my-first-post.md

Photo credit

Follow me