.Permalink not "permalinking"?

I’m sure I’m missing something here, but in the following code in my rss.xml I have

      <title>{{ if ne .Type "micro" }}{{ .Title }}{{ end }}{{if eq .Type "micro"}}{{ htmlUnescape .Content }}{{ end }}</title>
      <link>{{ .Permalink }}</link>
      <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
      {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
      <guid>{{ .Permalink }}</guid>
      <description>{{ .Content | html }}</description>

Which renders to

<p>Testing cross posting from my blog to other services</p>
<pubDate>Tue, 27 Dec 2022 00:00:00 +0000</pubDate>
<p>Testing cross posting from my blog to other services</p>

Why are my permalinks being rendered as relative and not absolute?

What’s your baseURL?

baseURL = ""

This has worked for me in the past because it has allowed me to test via localhost. Assuming there’s a better way?

The baseURL should be set to the fully qualified domain, including a trailing slash.

You can still test with Hugo server. It replaces the protocol+host+domain portion of the URL with http://localhost:1313/

1 Like

Ah, thank you. That does it and all is well now.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.