How to link pages

Hello, after a quick survey of the docs I got two ways for creating absolute links:

[Privacy Policy]({{< ref "/" >}}) // works only in MD
<a href="{{< ref "/" >}}">Privacy Policy</a>

I’m looking for something like this:

{{ makemealink . "/" }}

It should create the href attribute and the content, I would use it in the template file. Any suggestion?


If you want to force your url paths to be absolute when the site is build check the config parameter canonifyURLs : Configure Hugo | Hugo

1 Like

And there is also the function absURL | Hugo
So you can do:

<a href="{{ "/" | absURL }}">Privacy Policy</a>
1 Like