HUGO

RSS + relative urls

Context

I have a couple of domains pointing to the same website and I need the visitors to get no clues about the other urls. If two of the websites are example1.com and example2.com, visitors coming through example1.com must get no information about example2.com from the website itself.

Steps taken

With the suggestions from other forum posts, following lines were added to config.toml.

baseURL = ""
relativeurls = true

Issue

Everything works fine, except for the RSS urls. From this page, I hoped the absolute URL of each RSS entry would be inferred from the URL supplied to the RSS reader’s config. But clicking the links leads to nowhere.

Can someone help me out?

1st set

baseURL = “/”

check the generated rss file für relative URL’s

or look at mv modified template

1 Like

Thank you.

Little issue, when I run the server on localhost, hugo says it is served at //localhost:1313/ instead of http://localhost:1313. This is only when baseURL is set to "" or "/". Same with the URLs in the RSS feed. How do you add the http: prefix?

hugo is right, will serve HTTP on “//localhost:1313

Browsers extend HTTP or HTTPS from your entered URL. newer versions try to use HTTPS.

Enter http://localhost:1313 in your browser and you are fine. Same with RSS etc…
You wanted relative links, there are no protocol prefixes!

If baseURL = "/" is changed to say baseURL = "https://www.example.com", hugo displays http://localhos/(which is clickable in a terminal emulator and which is what I need) instead of//localhost/`. I’m not sure I get what you’re saying.

$ hugo version
hugo v0.84.0+extended linux/amd64 BuildDate=unknown

Edit: Looking at other posts, it is apparently intended.

you want to mix functions with hugo and a terminal emulator …

If you gibe an URL to any browser, it will divide host and path, using this host for all relative links of this site.

IF you want discuss teminal emulators, this is OFF topic for this forum.

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