Localhost:1313 instead of Domain on subpages!

Hello!

I’m having problems with my Hugo Website.
The issue is that on my website (jakubwieloch.com) the main page & tag page point to my domain but all the other “subpages” like my blog point to localhost:1313/path/to/content instead of domain/path/to/content. I have my baseURL set to my domain in the config.

After some Reverse Engineering I found that in the build website’s subpages html file, like I said it points to localhost instead of the domain. Also when I changed the title in my config, which also is displayed in the top right corner like here with the Hugo on its forum, the change didn’t happend on those subpages, which indicates that somehow or somewhat all subpages have the domain problem & the not applying changes issue which most likely causes the domain issue. Other than that my search & reverse engineering was unsuccessful.

I’m using Papermod as my theme, using Hugo Version: v0.128.2+extended on Debian Testing (Linux) & deploying my Website through Cloudflare Pages.

I also tried it different hugo versions mainly v0.112.4 & v0.131.0, but the issue stays.

If you want to take a look at the code I have my site’s code over on GitHub, so let me know if you found something.
Have great Day!

I suppose you build your site using hugo server which is for testing purposes. So you can view changes locally at localhost:1313

Therfore it uses that as baseURL.

To get the real result use the command without server.

hugo

Check the generated pages in public/ folder and you will see your domain url

Yes,

I was using Hugo server while creating these pages as a live preview, but the hugo command is automatically run (on cloudflare) when I push new content/changes to my Github, even if I do a “manual” build with the hugo command, the issue is still present (because essentially it’s doing the same).
The issue is with the built website!

I would really suggest you to view my website & go to either “Product” or “Blog”, and then try navigating even back to the main page. You will see what the problem is which I already describe in my first post.

Mmh. Then I would rather sugest check your cloudflare build and deploy. :slight_smile:

The site published in the intrrnet is generated using hugo server not hugo

Use view source in your browser and you will see the livereload javascript loaded which is only injected by the server call.

So either the build call is wrong or you have committed your public folder and this is deployed as is. Or a combination of both :wink:

2 Likes