Maybe "relativeURLs = true" isn't working properly, or maybe I haven't understood it

I’m starting with “Academic Hugo Theme”. To test it I decided to deploy the starting blog “as-is” to my own test site on a local machine with Apache. Now since this machine serves other sites, I opted to put the new site below the main http://my.local.domain/, so that it can be accessed by something like http://my.local.domain/NewSite. To do this I directed Hugo to produce relative URLs with relativeURLs = true. The fact is that the nice bubbles-wide.jpg background in the section Demos does not appear in the final display of the Site. Reviewing the produced index.html, i discovered that the <section id="demo" ...> tag, refers to the URL as url('/img/headers/bubbles-wide.jpg') and not as url('./img/headers/bubbles-wide.jpg'), as it should be. I don’t know who to “blame” for this: Hugo, Academic, or maybe me for not understanding how to deploy my new site.

This forum is not about opening topics to blame anyone or anything this is a support forum and we have guidelines that you are meant to follow before opening a topic.

Please have a look at: Requesting Help

You need to post the source code of your project so that people in this forum can have a look and hopefully point you to the right direction.

1 Like

You are right. I didn’t mean to be rude.
Maybe I should have reworded my last phrase as “… I don’t know where to direct my attention for searching a solution: to Hugo, to Academic or elsewhere”.
By the way, my project repository is at:

Is there anyone who can help me to spot the problem and its solution?

From what I’ve seen the Academic theme already uses .RelPermalink (relative URLs) for its assets handling.

The use of relativeURLs = true is the culprit of your problem especially since the project has a baseURL that points to a subdirectory.

As things are now for example the missing stylesheet has a URL of ./EESite/EESite/css/academic.min.dd629241ea9333c62c071f4a25f829ff.css which is obviously wrong.

To fix remove relativeURLs = true from the config. Then run hugo server --ignoreCache --gc to remove the cache and regenerate all resources.

After doing the above all assets load properly on my end.

Also as a slightly unrelated tip create a .gitignore file and within enter /public There is really no need to include the /public directory in git.

1 Like

Wow! Thanks. It worked exactly as you said.