Contents

Setup Hugo on Ubuntu

I setup hugo on my Ubuntu client PC.

1 Environment

1
2
3
4
5
6
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.5 LTS
Release:	18.04
Codename:	bionic

2 Install Hugo

I referred some pages to install hugo 

2.1. Install Homebrew

1
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then followed instruction in install.sh output.

1
2
3
4
$ echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/tato/.profile
$ eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
$ sudo apt-get install build-essential
$ brew install gcc

For run hugo command, I added path to ~/.bashrc after all.

export PATH=$PATH:$HOME/bin:/home/linuxbrew/.linuxbrew/bin


3 Git clone

Clone from private repository.

3.1 Clone repository

1
git clone git@gitlab.com:tatoflam/site.git

However, hugo server command failed as follows:

1
2
3
4
$ hugo server
Start building sites … 
Built in 3 ms
Error: Error building site: "/home/tato/repo/gitlab/site/content/posts/docker/setup-docker-on-ubuntu.md:132:1": failed to extract shortcode: template for shortcode "admonition" not found

This is because git submodule (LoveIt template llibrary) has not been cloned by git clone commmand.

3.2 Update submodule after git clone.

1
$ git submodule update --init --recursive

4 Start server

Finally, I could run hugo on Ubuntu.

1
$ hugo server

References