What and How should the URL paths be structured

Hello All,

I installed Hugo on my local computer and was coding for some learning. And here is what I want to understand -

I generated HTML codes running the hugo command. And the files generated in the Public folder (as expected). Now what I understand is that these HTML files should be uploaded to the public_html folder of the website on the server.

But this is where I need help - I want to upload them on a domain / server but inside a folder such that the entire site can be seen functional with a URL say https://xyz.com/hugodemo/.

From what I gathered from the gohugo website documentation, I do need to make changes into the config.toml file and then regenerate the HTML Files (after deleting the existing ones). But what should I be setting up actually?

My design is based on Bootstrap 5.x and this is in the themes folder. I also have my list.html and single.html files in folders arranged in the layouts folder - hugodemo/layouts/[folder-name]/list.html and hugodemo/layouts/[folder-name]/single.html. There are also some images stored in hugodemo/static/[folder-name]/file.jpg.

I hope someone can point me to the right direction.


you can do it in your config file

or in the command line -b

1 Like


Thanks :slight_smile:
So should I change these two parameters in the config.toml file -

baseurl = 'https://xyz.com/hugodemo/"
relativeURLs = true

Or there is something else that needs to be set?

The reason for me asking is the documentation of GoHugo is a little overwhelming for me as a starter.


but you can have different “Environments” see

1 Like

I do not declare it in my config file, bc I generate the files from an shell script with

looks like

hugo -b 'https://xyz.com/hugodemo/'

1 Like

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