[SOLVED] Bleak Theme won't work if deploying to a subdirectory on web server

I’m trying to setup hugo based blog in my wesite : https://aravindh.net/blog/
I’m using the bleak theme. In my config.toml, I have the following :
languageCode = "en-us" title = "Aravindh.net" baseURL = "https://aravindh.net/blog/" publishdir = "/var/www/html/blog/" relativeURLS = "true" canonifyURLs = "true" uglyURLs = "true" [params] # Warning Keys are case sensitives Subtitle = "Your subtitle !" description = "Everything is awesome !" cover = "/images/cover.jpg"
When I visit my blog page (https://aravindh.net/blog/) I get a list of posts as expected.
However, when I click on any of the two posts, it just goes blank. (My browser console doesnt show any missing resources or any other useful errors)

I tried visiting the direct urls to the posts manually on another browser, it works splendidly :frowning:
https://aravindh.net/blog/post/great-post.html

It is driving me nuts, and I wasted about two hours on it already. Please help!!!

Hi @Aravindh_Sampath I changed the title of your post since usually Hugo doesn’t have issues when the root of your project is a subdirectory on a larger site.

That said, I see what you mean about the pages not loading, BUT if I manually refresh with the new URL in the browser, it goes directly to the page (as you’ve already mentioned…just letting you know I’m getting the same thing).

My first thought is that this has to do with the AJAX/JS used in this theme. Have you submitted an issue with the theme’s creator by any chance?

Also, do you happen to have your site in a repo, maybe we can troubleshoot from there?

[[EDIT]]: One thing that sticks out to me right away is that you have Ugly URLs set to true in your config. Can you do me a favor and set these to false and see if that makes a difference? I’m wondering if it’s that the AJAX call looks for a specific index.html file instead…

@rdwatters Thanks for the response.

I put the source in https://github.com/aravindhsampath/hugo_blog

I will create an issue with the theme developer then. At the outset, with my limited knowledge, it appeared as if it was hugo not doing the right thing.

I added the Ugly URLs param just to test if that fixes the issue. It didnt. THe core problem remains the same with/without adding any *URLS = true :frowning:

It turned out to be an issue with the bleak theme. If anyone else runs into the same issue, adding tags to every post makes them visible again :slight_smile: In the first few lines of a new post add tags = [“first tag”, “second tag”].
I opened a separate issue with the theme github repo to notify the theme dev.

1 Like