Install the Hugo Static Site Generator on ArcoLinux
Hugo is a lightning-fast open-source static site generator that’s written in Go.
ArcoLinux is a rolling release Linux distribution based on Arch Linux.
Prerequisites
- ArcoLinux was installed using the ArcoLinuxL ISO with the easy installation option.
- The examples shown in this article were performed using Xfce Terminal.
- ArcoLinux was fully updated using the
sudo pacman -Syu
command.
Installation
I downloaded version 0.89.4 of Hugo extended. For the latest version or a different version, see the Hugo GitHub repo.
curl -L -o ./Downloads/hugo_extended_0.89.4_Linux-64bit.tar.gz https://github.com/gohugoio/hugo/releases/download/v0.89.4/hugo_extended_0.89.4_Linux-64bit.tar.gz
You’ll need to create the local folder structure, extract the tar archive, add the execute permission, and create a link:
sudo mkdir -p /opt/hugo
sudo tar zxf ./Downloads/hugo_extended_0.89.4_Linux-64bit.tar.gz -C /opt/hugo
sudo chmod +x /opt/hugo/hugo
sudo ln -s /opt/hugo/hugo /usr/bin/hugo
You’ve installed Hugo! To verify the version, you use the hugo version
command:
hugo version
I configured Git since this is a newly installed system. Use the credential.helper store
option to
save your GitHub credentials. Saving your credentials automatically authenticates you when GitHub
authentication is required instead of being prompted each time.
git config --global user.name "<Your Name>"
git config --global user.email "<your email>@users.noreply.github.com"
git config --global credential.helper store
I downloaded my existing Hugo site from GitHub along with the theme that I’ve chosen:
mkdir git
cd git
git clone https://github.com/mikefrobbins/mikefrobbins.com.git
cd mikefrobbins.com/themes/
git clone https://github.com/mikefrobbins/vienna.git
You can view your site locally by running the hugo server
command and visiting
http://localhost:1313/
.
hugo server
I write my content for this blog site in Markdown using VS Code. I preview the content with a locally installed version of Hugo. I use a private repo on GitHub to store the content. Any time I push a commit to GitHub, Netlify automatically performs a build of my blog site.
All of the software, tools, and hosting is free except for my domain name. The entire solution was uncomplicated to set up and configure.
References
Other resources
Adam Driscoll has a “Build fast, static websites, and host them for free” video about Hugo on his YouTube channel.