I feel like I’m missing something pretty obvious, but I’ve searched and read quite a bit and have still not been successful. I want every post that uses a “series” taxonomy to list all other posts in the series at the end of that post.
I’ve also tried to use the method described here, but I suspect I simply don’t understand it. When I include {{ $related := .Site.RegularPages.Related . }} in my single.html, I get an error claiming that the “:=” is unexpected.
You need to configure your related content if you want to use the .Related feature. It is in the docs you link to here: Related content | Hugo
You need to configure the related indices, as series is not one of the default indices used. So you probably need to add something like the following to your config.toml (or whatever the relevant values) :
Your single.html is not calling your related partial, so it is not being rendered.
Either put the contents of the related partial into the single.html layout, or call the partial.
{{ $related := .Site.RegularPages.Related . | first 5 }}
^ This bit gets the related pages
v This bit prints out the related pages, if there are any
{{ with $related }}
<h3>See Also</h3>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}