kaiiiz / hugo-theme-monochrome

Monochrome is a fast, clean and responsive hugo theme
https://kaiiiz.github.io/hugo-theme-monochrome/
MIT License
171 stars 52 forks source link

site search issue on server of server #29

Closed Ran-n closed 11 months ago

Ran-n commented 2 years ago

I have a particular issue and its that i have a server in my github base url that just links to various servers that are on other repositories. The problem comes when i try to search on any of those other servers, when i do only the results for the base one are available (and the other servers have the site search enabled).

For a more hands on example, you can go to https://ran-n.github.io/subs/ and you can see how it only searches on the pages available for the server located in https://ran-n.github.io/.

Obviously, the search functions perpectly when used on a local production server.

kaiiiz commented 2 years ago

After doing some testing, I found the issue is related to relativeURLs and canonifyURLs in your config. The current implementation of retrieving the URL of the index file is using the relLangURL function provided by hugo. However, relLangURL behaves unnormal and doesn't respect the baseURL setting if one of the above options is enabled.

It seems that using absLangURL doesn't encounter this issue so maybe a quick fix is to change the index retrieving process from relLangURL to absLangURL. I also consider replacing all of the relURL with absURL as I didn't notice such a problem before.

kaiiiz commented 11 months ago

Fixed in v2.0.0.