[Bug] CORS error when using multilingual sites, .css and .js files not loading
manronES opened this issue · comments
I confirm:
- I am running the extended version of Hugo version 0.91.0 or above to build my site.
- I have read the Hugo Clarity theme documentation.
- I have used the example site's config files as reference.
- I have reviewed other issues in this repository and mine is not recorded.
Hugo version
hugo v0.104.3-58b824581360148f2d91f5cc83f69bd22c1aa331+extended linux/amd64 BuildDate=2022-10-04T14:25:23Z VendorInfo=gohugoio
Where is this bug showing up?
In the browser: Hugo builds the site, but something doesn't look right.
Operating system
Windows 10
Browser (if applicable)
Chrome 105
Current behavior
Multilingual setup, two languages defined with different domain names, "es" (weight 1, baseURL example.es) and "en" (weight 2, baseURL example.com.). No baseURL defined in main config.toml (in any case, similar behavior with "main" baseURL set to either domain)
example.com (EN site) won't show correctly, as CSS and JS files won't load due to CORS error (HREF URLs domain set to example.es instead of example.com)
Same issue as #375 (closed)
Expected behavior
References to CSS and JS should have the correct domain name (language's baseURL)
Steps to reproduce
Access alternate language site
Relevant log output
No response
Related code
layouts/partials/head.html, lines 31 and 39 ($styles.Permalink)
layouts/partials/search/scripts.html, line 11 ($bundle2.Permalink)
Preferred solution
No response
Other information
No response