Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] CORS error when using multilingual sites, .css and .js files not loading #395

Open
4 tasks done
manronES opened this issue Oct 14, 2022 · 0 comments
Open
4 tasks done
Labels
bug Something isn't working

Comments

@manronES
Copy link

I confirm:

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

@manronES manronES added the bug Something isn't working label Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant