Apparently I didn’t take any notes when I originally converted my blog to hugo templating. This seems odd, so I probably just misplaced them. The blog content repo was created November 4th, 2018.
Setup steps
Initialize the submodule for your preferred theme.
Here’s a couple:
|
|
This will create a .gitmodules
file at the root of your repo, and a linked project in the target directory. The target will appear as a link to the provided repo url when viewed through GitLab, etc..
During setup/update of the blog content, these commands will run to sync the theme files by referencing the content of .gitmodules
:
|
|
Configure hugo with config.toml
Here’s a sample config:
|
|
theme
- points to the theme dir created by the
submodule init
above
- points to the theme dir created by the
languageCode
andtitle
- self-explanitory
pagination
andtaxonimies
- control how page collections are generated; I just use basic tags in my content config
Writing a post
hugo settings blog
content
Upgrading the versions of things
update cascades ftl
Hugo theme updated, stopped working
Needed new version of Hugo, best way to get was snap
Apt version of ansible was too old to support snap
So had to update both
Now Hugo can’t find the site config file, thinks it’s running in some other directory
need
- snap hugo in ansible play to get hugo 0.6+
pip install --user ansible
to get newer ansible
short version is: submodules are the worst
i’m pinning them to older versions of the templates
the good news is i can reproduce the hugo config-not-found problem locally without any of the other pieces
something about how it looks for the config in the current directory, but it thinks it’s running from root, possibly because of how snap installs it
wouldn’t have any of these problems if repos were kept up to date, so apt actually gave you not-ancient stuff
this is also probably my fault
tbf, i’m on a pretty old release of mint and don’t do any repo management
but then again, i’m getting old versions with a brand new droplet
Update 2020-08-23
The solution to the hugo snap problem was to not use snap for hugo. Instead, I went with the tarball install approach, and this allowed for the latest version of hugo and resolved the config.toml
not found problem.
Some warnings
When updating the submodule, it is best to clear the checkout dir completely from the droplet. It might make sense to build this step into the deploy play to ensure clean checkouts.