Updating Hugo 2022-06-27
Description: Challenges and solutions to upgrading this site.
Reading Time: 2
So life happened and I didn't update this blog in about 6 years, but that's another story for a later time.
In the interim, Hugo changed and matured considerably, which had a few breaking changes that upgrading to a current version of the site. Note that this was a jump from version 0.1.1 to 0.101.0 - 100 revisions is no small gap, so this was to be expected!
Templates
HTML comments are now stripped by default, and have to be escaped with the
safeHTML
filter.
Page indexes
The page index variables, especially if you wanted to have a section changed.
The variables seem to be:
.Data.Pages - Per type top level index pages for the site
.Site.Pages - All pages (both index and content)
.Site.RegularPages - only content pages
In previous versions .Data.Pages
had only content pages, so this was a bit
unexpected.
3rd party tools
Bootstrap 3.2.2 and jQuery 2.1.3 were used on the earlier site.
Bootstrap in particular had a ton of breaking changes between 3.x and current 5.x - removal of the icon font, build method including SASS compiler changes, and so on. After banging my head against this for an hour I just gave up and updated to 3.4.1, which might not be newest but at least works. Not a great experience.
Going to current jQuery 3.6.0 had no issues.
Process
My Makefile wizardry has greatly improved in the last few years, so I changed
over the build to use make
for everything, including downloading/copying the
bootstrap/jQuery dependencies.