Publish Hugo in Site Subdirectory

Good Evening,
Am trying to publish hugo in /blog subdirectory of my domain. Have tried using baseurl as eNomCentral - domain name, web site hosting, email, registration with build command as hugo -b siteurl.com/blog and publish directory as public/blog which generated 404 error on the site.

I intend to use / /landing/index.html 200 redirect to make a landing page but currently stuck at deploying the site. I can deploy it in baseurl easily and its working.

I thought of something like
hugo && mv /* /blog/ && cd /blog/landing/ && mv /blog/landing/* /
but doesn’t seem like a legit way of doing it.

Any help is appreciated, but please don’t link me to Hugo’s documentation where they just say change baseURL.

Project Link: https://angry-bassi-5d2cfc.netlify.app/
Repo: https://bitbucket.org/panaino/projectroot.ml/src/master/

Aw, why not?! :sweat_smile:

In all seriousness, you should be able to specify /blog as the publish directory, rather than specifying the URL in its entirety. Does this help at all?

1 Like

Actually mistyped the URL :3 Else it was working, but thanks.

D’oh! By any means, I’m happy that this was resolved :+1:

hi, i know it has been a long time but i am dealing with kinda the same thing.
i have a static plain htm and css site on netlify and i want to use hugo for bloging and i want it as a sub directory as you said /blog. i am new to hugo i have extrated a hugo theme in a subfolder of my main project and deployed it to netlify i tried to change the base url but i know im making something wrong and i dont know where to get started. thanks.

here is github repo GitHub - RUBINELEZI/domed

Could you instead link us to your netlify deploy logs? Our staff cannot become familiar with your source code, but we’re pretty good at seeing problems from the build logs, and they have details you haven’t included here like, for instance, your build command, and what seems “wrong” by your view that we may be able to guess from the build logs.

We can see every page in the UI that you can (minus some info like your credit card details and your personal settings page), so starting with a link to the failing logs and a description of what is wrong would be a great starting place!