Links in sidebar are to localhost not remote site

Hello
I am a hugo ‘learner’ and have been using it in conjunction with R blogdown. I say that because I think this a hugo question not a blogdown question, but I am not certain. Apologies if I have it wrong.

Anyway, my workflow is to serve the site locally then upload from the local ‘public’ folder as recommended in the blogdown book. The site iuses the the techdoc theme.

The baseURL in my hugo.toml file is baseURL = “http://casualties.cycinfo.uk”. I’ve also tried “/” and “//casualties.cycinfo.uk

The problem I can’t solve is that all the sidebar links point to localhost.

Actually the only reason /css/theme.min.css does not point to localhost is that, in attempting a solution, I edited head.html to show a relURL rather than an absURL and I put a forward slash in front of the url. But I think that edit is a bodge and I couldn’t do the same for the sidebar menu as I didn’t understand what code in which template was creating it. (Top menu is created in the toml file so it is OK).

I would be very grateful if somebody could identify where I am making a mistake.

Many thanks

(Sorry I had shown some code but kept violating the 2-link limit so took it out)

You generate your site using the development server command hugo server. Here your basURL is replaced with localhost.

You have to use the command

hugo

Without the server and then take the result from public to your real webservers document root

Thank you, that was it exactly. I was fixated on using r blogdown commands but just had to go to the terminal and use ‘hugo’.

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