Permalink beginner

Hi all,

I understand Page.URL will soon no longer be supported. I’ve never used Permalinks and I’m having a hard time wrapping my head around that. I have read the documentation but it is still very unclear.

Do I have to write something like this for every link to another page on my website? Doesn’t look like economical code writing.

 {{ range .Site.Pages }}
      {{ if eq .Title "Syllabus" }}
           <a href="{{ .RelPermalink }} ">SYLLABUS</a>

I cannot find online explanations of the basic concept.

Thanks for any piece of advice.

What are you trying to do with the above? A menu? A cross page reference?

The .Permalink and .RelPermalink variables just hold the absolute and relative URL to a content page (in this instance).

Typically within a range statement one would just need to wirte something like:

 {{ range .Site.Pages }}
           <a href="{{ .RelPermalink }} ">{{ .Title }}</a>

Hi Alexandros,

I’m only trying to insert a link to the page syllabus.html. It’s not a menu, it’s just one signe link to a specific page, a cross page reference, yes. If I write what you suggest I will get a list of links for all the pages on my site, right?

I’m used to writing:

 <a href="/content/syllabus.html ">SYLLABUS</a>

I’ve been managing things like that with Jekyll so far. It is working fine at the moment but from what I understand it is not viable since Hugo will stop supporting Page.url.

Again, I have read the doc and there are loads of things that are above my level of understanding ! I’m trying to find the right tutorial for me. :wink:

I think you have a fundamental misunderstanding of what this means.


This will continue to work as it always has. This has no relation to the deprecation of .Page.URL.

You’re right. I’m out of my depth.
Thanks for your answer.