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] wrong load stylesheet and JS on multihost (multilingual) #126

Closed
sunuazizrahayu opened this issue Dec 11, 2020 · 9 comments · Fixed by #168
Closed

[BUG] wrong load stylesheet and JS on multihost (multilingual) #126

sunuazizrahayu opened this issue Dec 11, 2020 · 9 comments · Fixed by #168
Labels
bug Something isn't working

Comments

@sunuazizrahayu
Copy link

sunuazizrahayu commented Dec 11, 2020

my config:

languages:
  id:
    baseURL: "site.com/id/"
    languageName: "Indonesia"
  en:
    baseURL: "site.com/en/"
    languageName: "English"

on preview of hugo server, second language (english) load stylesheet from first languange (indonesia).
it produce
Capture
i think this config must use their own baseUrl.
so stylesheet must loaded as http://site.com/en/my.css, not http://site.com/id/my.css


Noted points:

  1. Always uses 1st Language's (by alphabetical order) assets
@adityatelange
Copy link
Owner

adityatelange commented Dec 11, 2020

Style-sheet should be common ! Why do they need to be loaded different for different language ?

Oh my bad, understood !

@adityatelange adityatelange added the bug Something isn't working label Dec 11, 2020
@sunuazizrahayu
Copy link
Author

it's bug on load .js on footer too

@sunuazizrahayu sunuazizrahayu changed the title [BUG] wrong load stylesheet on multihost (multilingual) [BUG] wrong load stylesheet and JS on multihost (multilingual) Dec 11, 2020
@adityatelange
Copy link
Owner

adityatelange commented Dec 11, 2020

@sunuazizrahayu I actually feel this is hugo's bug !

  1. head is not using partialCached so cached page shouldn't be used of some other lang.
  2. The asset generated is using Permalink which means it is a permanent link to the asset.
  3. Always uses 1st Language's (by alphabetical order) assets, that means hugo generates bundled asset only once

@sunuazizrahayu
Copy link
Author

how about make this theme to use their own assets on every lang?

@adityatelange
Copy link
Owner

how about make this theme to use their own assets on every lang?

Wait, we'll research about this more ..

@sunuazizrahayu
Copy link
Author

when render, it's produce assets for every host separately
Capture

@adityatelange
Copy link
Owner

@sunuazizrahayu

Reading https://gohugo.io/content-management/multilingual/ and set up config like mentioned here

image

image


image

image

image

I can still observe that urls aren't generated the way they should be a/c to docs. So I'd recommend you to report this bug to hugo team if it isn't already

@sunuazizrahayu
Copy link
Author

@adityatelange any solution how to make this theme to load assets from each language?

@adityatelange
Copy link
Owner

@adityatelange any solution how to make this theme to load assets from each language?

Not really. But I think it is better to report this issue to hugo team, this is not a issue specific to this theme ...

wersoo added a commit to wersoo/hugo-PaperMod that referenced this issue Jan 4, 2021
adityatelange pushed a commit that referenced this issue Jan 5, 2021
CORS issue for multidomain setup (#168)
adityatelange added a commit that referenced this issue Jan 20, 2021
…126"

Doesn't work with multilingual config with no specific baseurl

This reverts commit ad79fda.
@adityatelange adityatelange mentioned this issue Dec 25, 2021
9 tasks
kylethedeveloper pushed a commit to kylethedeveloper/hugo-PaperMod that referenced this issue Feb 21, 2023
kylethedeveloper pushed a commit to kylethedeveloper/hugo-PaperMod that referenced this issue Feb 21, 2023
kylethedeveloper pushed a commit to kylethedeveloper/hugo-PaperMod that referenced this issue Feb 21, 2023
…dityatelange#126"

Doesn't work with multilingual config with no specific baseurl

This reverts commit e55e2be.
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

Successfully merging a pull request may close this issue.

2 participants