Aliases listed in output, but not used in project

Yeah, I got that from the topic. What I’m suggesting is a way to directly see what they are, to help you debug. :nerd:


In case others find their aliases ponderous, here’s a shortcode for ya; copy to layouts/shortcodes/whatthealiases.html:

{{  range $p := .Site.Pages -}}
<pre>
<code>
{{ range .Aliases }}
{{  . | printf "%-35s" }}       {{ $p.RelPermalink -}}
{{ end -}}
</code>
</pre>
{{- end -}}

That’s the code from https://gohugo.io/news/http2-server-push-in-hugo/, with some formatting for reading.

On the other hand… disableAliases = true.

1 Like