No Such Template Partials Paginator
It’s no secret that use Hugo for the content of this site. It’s a static site generator, which means I can have a lot of generated links, which are good and help enrich the content and the experience, but only at build time. That’s exactly what I was going for, so why bother with a full-on CMS? Hugo uses a directory structure, as well as Go templates, to build the site. There have been some changes to how Hugo manages this over the years, and I’ve been running up on some of those issues because of the runtime environment that I use, and it’s age.
Table Of Contents
What’s the deal?
./assets/hugo/hugo.exe new content/posts/hugo-no-such-template-partials-paginator.md
ERROR html/template:index.html:36:15: no such template "partials/paginator.html"
Yup, I’m getting this no such template error every time I run a command with hugo that will parse the theme. Why, you might ask? hugo version returns v0.157.0 for my installed binary, however my runtime environment uses v0.122 and, as one can imagine, there has been a game-breaking change in there. You might have read my previous post about how this functions, but the TLDR for how we got here is that my runtime environment on my local build box is out of date. That’s certainly an issue, but it’s one I’ll need to work around for the moment.
The Workaround
The easy workaround, is to cheat. I have the v0.122 binaries in the assets directory and I call them as such from the main directory:
./assets/hugo/hugo new content/posts/hugo-no-such-template-partials-paginator.md
You can get them from the Hugo Github releases page and just stash them in there. Yeah, they will take up some extra drive space but it’s trivial in the grand scheme of things. They say that the most permanent things are temporary, and that can be the case in several ways, but this is just waiting on the revamp of my homelab to become resolved. I need to rebuild the worker from bottom up, so that will be the time to update to the newest runtime environment, but I can also fix the site to build in v0.157, it’s just that it won’t build in v0.122 any longer.
Hugo has posted how Google Analytics should work on their page, so it’s not their fault. You can see that here. It’s the fault of me being very behind on my build environment, which is all types of risk itself (did you hear about CVE-2026-3497?) because of it being, basically, out of date.
OK But Why, Though?
There was a change in how the built-in template for Google Analytics works. It had to do with how the partials are defined. I now have an override for google_analytics_async.html in my partials directory, as well as a _partials directory with a google_analytics_async.html partial in it. There were a number of breaking changes in the release of v0.123, and this is where it stems from. The _partials directory is no longer used, to my knowledge, but it did still build correctly in the later versions, last I checked, so I won’t argue too much.
I’ve got my Google Analytics partial set in my footer, which appears on every page. That lives in layouts\partials\footer.html and I had the following in there:
{{ if not .Site.IsServer }}
{{ template "_internal/google_analytics_async.html" . }}
This wouldn’t build on v0.122 but it would on later builds. To quickly rectify the situation, I updated my theme by pulling from the git repository, and investigated further. The theme was updated to support the new templates, so I needed to locate the old files, which I found through a not-insignificant amount of searching, and added it to my layouts as partials\google_analytics.html. The newer binaries want to use the internal template, so I just commented that out for easy remediation later.
{{ if not hugo.IsServer }}
{{/* {{ template "_internal/google_analytics_async.html" . }} */}}
{{ partial "google_analytics.html" . }}
{{ end }}
This might come up for someone, so it’s helpful to have it here. The error comes up because the template crashes prior to processing the paginate partial, so it’s a little strange, but I’ve tracked it down to this. I’m also keeping it here for when I need to do the update, which seems like it might take a little while because of how out of date the build box is (it’s on Ubuntu Focal). And, as another note to myself, git submodule update --init --recursive will pull the files for the submodules. I bounce around between macOS, Linux, and Windows so my environments change pretty often, and sometimes I just need to pull that submodule down. It’s been a while since I wrote We All Live in a Broken Git Submodule and it’s starting to show.
In case you’re wondering, the if not hugo.IsServer statement checks to see if you’re running hugo server and avoids putting that partial in there if you are. It would result in weird and pointless analytics.
There’s a lot of big changes to the template system in Hugo v0.146 so I’m sure I’ll need to address that at some point, so stay tuned.
./content/posts/hugo-no-such-template-partials-paginator.md 1:1 suggestion Try to keep the Flesch-Kincaid marktoso.Readability grade level (8.22) below 8. 1:1 suggestion You averaged 1.27 complex marktoso.Kiss words per sentence 9:81 suggestion Try to keep sentences short (< Microsoft.SentenceLength 30 words). 9:122 warning Use first person (such as ' I Microsoft.FirstPerson ') sparingly. 9:266 warning Use first person (such as ' I Microsoft.FirstPerson ') sparingly. 9:313 suggestion 'CMS' has no definition. Microsoft.Acronyms 9:351 suggestion Verify your use of 'as well Microsoft.Vocab as' with the A-Z word list. 9:395 suggestion Try to keep sentences short (< Microsoft.SentenceLength 30 words). 9:553 warning Use first person (such as ' I Microsoft.FirstPerson ') sparingly. 13:18 warning Don't use end punctuation in Microsoft.HeadingPunctuation headings. 20:6 warning Use first person (such as Microsoft.FirstPerson 'I'm') sparingly. 20:58 warning Use first person (such as ' I Microsoft.FirstPerson ') sparingly. 20:170 warning Use first person (such as Microsoft.FirstPerson 'my') sparingly. 20:199 warning Use first person (such as Microsoft.FirstPerson 'my') sparingly. 20:307 suggestion Try to keep sentences short (< Microsoft.SentenceLength 30 words). 20:328 warning Use first person (such as Microsoft.FirstPerson 'my') sparingly. 20:331 suggestion Consider using 'earlier' Microsoft.ComplexWords instead of 'previous'. 20:429 suggestion 'TLDR' has no definition. Microsoft.Acronyms 20:442 warning Try to avoid using Microsoft.We first-person plural like 'we'. 20:462 warning Use first person (such as Microsoft.FirstPerson 'my') sparingly. 20:488 warning Use first person (such as Microsoft.FirstPerson 'my') sparingly. 22:4 suggestion 'The Workaround' should use Microsoft.Headings sentence-style capitalization. 23:91 warning Use first person (such as ' I Microsoft.FirstPerson ') sparingly. 27:223 suggestion Try to keep sentences short (< Microsoft.SentenceLength 30 words). 27:362 warning Use first person (such as Microsoft.FirstPerson 'my') sparingly. 27:393 suggestion Try to keep sentences short (< Microsoft.SentenceLength 30 words). 27:511 warning Use first person (such as ' I Microsoft.FirstPerson ') sparingly. 29:171 suggestion Try to keep sentences short (< Microsoft.SentenceLength 30 words). 29:189 warning Use first person (such as Microsoft.FirstPerson 'me') sparingly. 29:198 warning Consider removing 'very'. Microsoft.Adverbs 29:213 warning Use first person (such as Microsoft.FirstPerson 'my') sparingly. 29:290 suggestion 'CVE' has no definition. Microsoft.Acronyms 29:294 error Use an en dash in a range of Microsoft.RangeFormat numbers. 29:294 warning In most cases, use 'from' or Microsoft.Ranges 'through' to describe a range of numbers. 31:4 suggestion 'OK But Why, Though?' Microsoft.Headings should use sentence-style capitalization. 31:4 warning Avoid using acronyms in a Microsoft.HeadingAcronyms title or heading. 31:21 warning Don't use end punctuation in Microsoft.HeadingPunctuation headings. 32:112 suggestion 'are defined' looks like Microsoft.Passive passive voice. 32:183 warning Use first person (such as Microsoft.FirstPerson 'my') sparingly. 32:206 error More than 3 commas! marktoso.TresComas 32:208 suggestion Verify your use of 'as well Microsoft.Vocab as' with the A-Z word list. 32:442 warning Use first person (such as Microsoft.FirstPerson 'my') sparingly. 32:516 warning Use first person (such as ' I Microsoft.FirstPerson ') sparingly. 32:530 warning Use first person (such as ' I Microsoft.FirstPerson ') sparingly. 34:10 warning Use first person (such as Microsoft.FirstPerson 'my') sparingly. 34:45 warning Use first person (such as Microsoft.FirstPerson 'my') sparingly. 34:133 warning Use first person (such as ' I Microsoft.FirstPerson ') sparingly. 40:64 warning Consider removing 'quickly'. Microsoft.Adverbs 40:105 warning Use first person (such as Microsoft.FirstPerson 'my') sparingly. 40:176 suggestion Try to keep sentences short (< Microsoft.SentenceLength 30 words). 40:186 suggestion 'was updated' looks like Microsoft.Passive passive voice. 40:230 warning Use first person (such as ' I Microsoft.FirstPerson ') sparingly. 40:272 warning Use first person (such as ' I Microsoft.FirstPerson ') sparingly. 40:346 warning Use first person (such as Microsoft.FirstPerson 'my') sparingly. 40:450 warning Use first person (such as ' I Microsoft.FirstPerson ') sparingly. 47:114 warning Consider using 'before' Microsoft.Wordiness instead of 'prior to'. 47:216 suggestion Try to keep sentences short (< Microsoft.SentenceLength 30 words). 47:216 warning Use first person (such as Microsoft.FirstPerson 'I'm') sparingly. 47:249 warning Use first person (such as ' I Microsoft.FirstPerson ') sparingly. 47:556 warning Use first person (such as Microsoft.FirstPerson 'my') sparingly. 47:606 warning Use first person (such as ' I Microsoft.FirstPerson ') sparingly. 47:648 suggestion Try to keep sentences short (< Microsoft.SentenceLength 30 words). 47:671 warning Use first person (such as ' I Microsoft.FirstPerson ') sparingly. 47:681 warning Try to avoid using Microsoft.We first-person plural like 'We'. 47:735 warning Try to avoid using Microsoft.We first-person plural like 'we'. 51:1 suggestion Try to keep sentences short (< Microsoft.SentenceLength 30 words). 51:131 warning Use first person (such as Microsoft.FirstPerson 'I'm') sparingly. 51:153 suggestion Consider using 'discuss' Microsoft.ComplexWords instead of 'address'. 53:40 suggestion 'was checked' looks like Microsoft.Passive passive voice. 53:146 suggestion 'was checked' looks like Microsoft.Passive passive voice. 53:184 suggestion Verify your use of 'as well Microsoft.Vocab as' with the A-Z word list. 53:210 warning Use first person (such as ' I Microsoft.FirstPerson ') sparingly. 53:284 suggestion 'was put' looks like passive Microsoft.Passive voice.✖ 2 errors, 44 warnings and 27 suggestions in 1 file.