Local Server badly generates my website

This is happening because Hugo does not clean up after itsself. You removed or moved some pages (or changed their config), so they became 404’s. This became visible after restarting the Hugo server (because this restart cleared everything).

1 Like


So I thought it was solved, I erased everything, folders. I created a new site in a folder ‘arnauld’ launched the sever with hugo server stopped it 2 or 3 times, address to see my site was http://localhost:1313/ and then suddenly after having stopped the server and re-launched it, it tells me the site is at http://localhost:1313/blog/

So it added /blog/ at the end and of course my site is partially broken.

I don’t understand why it added /blog/ at the end of the address…

See my previous response.


Thank you. What do you mean by

the source code repository ?

I am just running Hugo on my computer with a simple theme. What do you want me to share?

@jmooring is referring to a repository on Github, which is what many regulars here are using. If you set that up as a public repository, everyone can clone it and that way reproduce your problem. Hopefully.

Ok, thank you, I understand. I don’t use Github but I will try to set it up.
However I think my problem is more to do with Hugo by itself, at least for my computer. I am using Manjaro now and the last time I used Hugo was on Linux Mint and I didn’t encounter any difficulties.

To test again, I deleted my local website, and generated a new website with a different name, a different theme, created a few posts with pictures, launched the sever and everything went fine, I could acess the site at http://localhost:1313/ , images appeared fine.

Until I stopped the server, launched it again and, again, it tells me to view my site at http://localhost:1313/blog/ ( but why did it add blog at the end of the adress??), and again problems arise. This time the images don’t show up in my posts, just their description… My images are in the static folder and I add them with ![wuhan school](/school-hubei-wuhan-old.jpg )

Could it be that it is Hugo for the Manjaro distribution that may be faulty?

That’s very weird because I have used Hugo for more than 3 years for my personal blog without any difficulties…

Just zip up your source code and post it somewhere for us to download. Let us see your code.

You mean my whole folder containing my site?

Yes, the root directory of your project.

Here it is, I uploaded it on my own selfhosted little server: Jirafeau, your web file repository

Your config.toml file:

baseURL = 'https://arnauld.org/blog/'

You are telling hugo that your published files (the files created in the public directory when you run hugo) will be placed in the /blog/ directory of the site served at https://arnauld.org/.

The directory in which your source files reside is irrelevant.

When you run hugo server the published files are served from http://localhost:1313/blog/.

The “About” link in your menu results in a 404 because you have not created an “about” page in your content directory.

1 Like

Ok, thank you very much. I will change this when I am back at my computer. I thought the baseURL was the internet adress at which my website will be accessible when online. So what to put there as my blog will be accessible at this adress ‘Arnauld’ when online ?

It is.

So what’s wrong ?

Nothing is wrong. I downloaded your zip file, extracted it, cd’d into the directory, then ran hugo server. Everything is functioning as it should.

But on my computer it is not working, I can’t see the images…

That’s because your image links are like this:


Instead of:

1 Like

Ok, I see, I will change that. Thank you again for your help and patience :slight_smile:

You can also write your image links like:

school-hubei-wuhan-old.jpg  <!-- no leading slash -->

This works because the theme author set a base attribute:


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