Yet another "BaseURL with subfolder results in broken links" issue


I hope you are doing well. Apologizes by advances for this post, but I came accross many posts (such as this one) and I still could not solve my issue.

Problem statement
My problem is that file true locations and href are not corresponding.


  • I created my first Hugo blog on GitHub using the Anake theme, and I successfully deployed it on GitHub Pages.
  • I also bounded the blog to a custom domain (
  • My blog has a subfolder baseURL:
  • Every href that is used employs resources RelPermalink property to obtain links. Obtained hrefs are relative to and not (it is a problem, isn’t it?)
  • No <base> tag has been added

Here is the config.toml file:

baseURL = ''
languageCode = 'fr-FR'
title = 'Weekly tech'
theme = 'ananke'

Paginate = 10
summaryLength = 40

Details and examples
My issue is that all the links are broken, meaning:

  • The impossibility to navigate
  • No CSS
  • No JS

When I reach the website address, I can see the index.html page.

But when I click on the link of one post, it adds the subfolder as a prefix to the address (i.e. ) and therefore the page is not found.

When I remove the subfolder from the address, the post can be found:

Here is an example of how I add a CSS file using a template located in assets:

{{- $styles := resources.Get "main.scss" | resources.ExecuteAsTemplate "main.scss" . | resources.ToCSS | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}">

This resource is located at<hash>.css, but the (relative) href displays /weekly-tech/main.min.<hash>.css, meaning that the full href is<hash>.css.

To make this work, it seems that:

  • Either I should ensure that the location of resources (other than the main index.html) is in a weekly-tech folder
  • Either I should make sure to remove the first /weekly-tech/ from href using RelPermalink
    But none of the solution looks clean.

Do you know how I could correct this?

Kind regards,

I had a quick look at your project. I have not read your entire post, but the site looks normal. I’m not sure I understand the above statement, though:

  • When running locally It correctly points to /weekly-tech/ananke/css/main.min.css

If that is not the case for your production site, I would start looking at your configuration/Hugo version/not sure, but the above should just work.

1 Like

What does this mean?

Sorry for the misunderstanding, I changed things since I posted. It appears that the problem I encountered was due to the custom domain that I tried to bound with the website.

Here, everything works perfectly at

EDIT: not everything works perfectly, I notice that some images are not found. Gonna try to figure this out

Hi there,

I hope that you are doing well.

The problem was due to an invalid GitHub Actions template in the Hugo documentation; after removing it and using the Hugo workflow proposed by GitHub the problem was solved.

Thank you for your help!

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