Installation
Table of Contents
Documentation - This article is part of a series.
Simply follow the standard Hugo Quick Start procedure to get up and running quickly.
Detailed installation instructions can be found below. Instructions for updating the theme are also available.
Installation #
These instructions will get you up and running using Hugo and Blowfish from a completely blank state. Most of the dependencies mentioned in this guide can be installed using the package manager of choice for your platform.
Install Hugo #
If you haven’t used Hugo before, you will need to install it onto your local machine. You can check if it’s already installed by running the command hugo version
.
You can find detailed installation instructions for your platform in the Hugo docs.
Create a new site #
Run the command hugo new site mywebsite
to create a new Hugo site in a directory named mywebsite
.
Note that you can name the project directory whatever you choose, but the instructions below will assume it’s named mywebsite
. If you use a different name, be sure to substitute it accordingly.
Download the Blowfish theme #
There several different ways to install the Blowfish theme into your Hugo website. From easiest to most difficult to install and maintain, they are:
- Git submodule (recommended)
- Hugo module
- Manual file copy
If you’re unsure, choose the Git submodule method.
Install using git #
This method is the quickest and easiest for keeping the theme up-to-date. Besides Hugo and Go, you’ll also need to ensure you have Git installed on your local machine.
Change into the directory for your Hugo website (that you created above), initialise a new git
repository and add Blowfish as a submodule.
cd mywebsite
git init
git submodule add -b main https://github.com/nunocoracao/blowfish.git themes/blowfish
Then continue to set up the theme configuration files.
Install using Hugo #
For this method you’ll use Hugo to manage your themes. Hugo uses Go to initialise and manage modules so you need to ensure you have go
installed before proceeding.
Download and install Go. You can check if it’s already installed by using the command
go version
.Make sure you are using Go version 1.12 or later as Hugo requires this for modules to work correctly.From your Hugo project directory (that you created above), initialise modules for your website:
# If you're managing your project on GitHub hugo mod init github.com/<username>/<repo-name> # If you're managing your project locally hugo mod init my-project
Add the theme to your configuration by creating a new file
config/_default/module.toml
and adding the following:[[imports]] path = "github.com/nunocoracao/blowfish/v2"
Start your server using
hugo server
and the theme will be downloaded automatically.Continue to set up the theme configuration files.
Install manually #
Download the latest release of the theme source code.
Download from GithubExtract the archive, rename the folder to
blowfish
and move it to thethemes/
directory inside your Hugo project’s root folder.Continue to set up the theme configuration files.
Set up theme configuration files #
In the root folder of your website, delete the config.toml
file that was generated by Hugo. Copy the *.toml
config files from the theme into your config/_default/
folder. This will ensure you have all the correct theme settings and will enable you to easily customise the theme to your needs.
module.toml
file if one already exists in your project!Depending on how you installed the theme you will find the theme config files in different places:
- Hugo Modules: In the Hugo cache directory, or download a copy from GitHub
- Git submodule or Manual install:
themes/blowfish/config/_default
Once you’ve copied the files, your config folder should look like this:
config/_default/
├─ config.toml
├─ markup.toml
├─ menus.toml
├─ module.toml # if you installed using Hugo Modules
└─ params.toml
theme = "blowfish"
to the top of your config.toml
file.Next steps #
The basic Blowfish installation is now complete. Continue to the Getting Started section to learn more about configuring the theme.
Installing updates #
From time to time there will be new releases posted that apply fixes and add new functionality to the theme. In order to take advantage of these changes, you will need to update the theme files on your website.
How you go about this will depend on the installation method you chose when the theme was originally installed. Instructions for each method can be found below.
Update using git #
Git submodules can be updated using the git
command. Simply execute the following command and the latest version of the theme will be downloaded into your local repository:
git submodule update --remote --merge
Once the submodule has been updated, rebuild your site and check everything works as expected.
Update using Hugo #
Hugo makes updating modules super easy. Simply change into your project directory and execute the following command:
hugo mod get -u
Hugo will automatically update any modules that are required for your project. It does this by inspecting your module.toml
and go.mod
files. If you have any issues with the update, check to ensure these files are still configured correctly.
Then simply rebuild your site and check everything works as expected.
Update manually #
Updating Blowfish manually requires you to download the latest copy of the theme and replace the old version in your project.
Download the latest release of the theme source code.
Download from GithubExtract the archive, rename the folder to
blowfish
and move it to thethemes/
directory inside your Hugo project’s root folder. You will need to overwrite the existing directory to replace all the theme files.Rebuild your site and check everything works as expected.