Hugo - Link another page with a shortcode

In Hugo, I sometimes want to link to other posts in a see also section. I want to just give the post name and be done with the link. However Hugo only provides ref and relref. So I made the following shortcode in layouts/shortcodes/link.html : {{ $pageName := index .Params 0 }} {{ with .Site.GetPage $pageName }} <a href="{{ .RelPermalink }}">{{ .Title }}</a> {{ end }} When called liked this in a page :...

September 19, 2021 · 1 min · Jonas DOREL