paapereira.xyz

New Hugo theme

I refreshed my website face with a new theme based on Bear Blog.

The theme, for Hugo, is the hugo-bearblog theme.

Removing the older theme

It seems there is a new and more robust way to manage themes today, by using Hugo Modules, which replaced the older method of cloning themes into the themes directory.

So, I’m replacing the theme and the theming method.

First of, we must removed the old theme. I was using the simple-list theme.

1git submodule deinit -f -- themes/simple-list
2git config -f .gitmodules --remove-section submodule.themes/simple-list
3
4git add .
5
6git rm -f --cached themes/simple-list
7rm -rf themes/simple-list

Adding the new theme as a Hugo module

Initialize the module:

1hugo mod init gitlab.com/paapereira/paapereira.gitlab.io

Add the module in hugo.toml

1[module]
2  [[module.imports]]
3    path = "github.com/janraasch/hugo-bearblog"

Get the module:

1hugo mod tidy
2hugo mod get

And that’s it. When theres is a new version of the theme it can be updated with hugo mod get -u.

Theme customizations

To add customizations check the copy the original file you want to change from the there repo and add it to a layouts/ directory.

In my case I have tinkered with:

You can check my source code.

Gitlab deploy

I also had to tweak my .gitlab-ci.yml and in go.mod use the ‘go 1.22’ version.

You can check my source code.

#Hugo