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

Resources fetched via resources.Get and similar should be language agnostic #5017

Closed
bep opened this issue Jul 31, 2018 · 4 comments · Fixed by #5018
Closed

Resources fetched via resources.Get and similar should be language agnostic #5017

bep opened this issue Jul 31, 2018 · 4 comments · Fixed by #5018

Comments

@bep
Copy link
Member

bep commented Jul 31, 2018

Testing this with multiple languages with SCSS and font paths etc. shows that doing this per site/language, adding the language code to the permalink etc.), probably was a mistake and need some rethinking.

  • You get duplication of identical content, with added processing time
  • You end up with path issues that seem to be hard to find a way around (@fa-font-path is my current head struggler)

It is currently possible to define an assets dir per language, but I think we need to remove that possibility. I doubt that anyone uses it. This also would mean that if you want per-language resources, you would have to set the path yourself.

I think we need to do this sooner rather than later. I just added a second language to a site with a fair amount of SASS files, and doing that twice is doubling the processing time.

/cc @kaushalmodi @regisphilibert @onedrawingperday

@bep bep added the Proposal label Jul 31, 2018
@bep bep added this to the v0.46 milestone Jul 31, 2018
@regisphilibert
Copy link
Member

regisphilibert commented Jul 31, 2018

I agree with all of the above.

I just realized that the resources permalink includes the language (I'd be surprised many people did) so I'm confident this can be changed with minimum codebreak.

I personnaly can't find any use case for having two versions of a resources per language (since per language CSS can easily be achieved within one common stylesheet by targeting the lang attribute).

For JS and the rest, Hugo Pipes gives you sufficient legroom to adapt your pipepline per language (language bundles, specific js lang variables outputted before the main script etc...).

bep added a commit to bep/hugo that referenced this issue Jul 31, 2018
With the newly released Hugo Pipes, resources fetched and processed via `resources.Get` and similar was published to the relevant language sub folder when in multilingual mode.

The thought behind that was maximum flexibility with support for `assetDir` per language.

In practice this was a bad idea:

* You get duplication of identical content, with added processing time
* You end up with path issues that seem to be hard to find a way around (`@fa-font-path` is one example)

This commit changes that. Now there is only one `assetDir` and if you, as one example, need to generate a CSS per langugage, you need to set the paths yourself.

Fixes gohugoio#5017
bep added a commit to bep/hugo that referenced this issue Jul 31, 2018
With the newly released Hugo Pipes, resources fetched and processed via `resources.Get` and similar was published to the relevant language sub folder when in multilingual mode.

The thought behind that was maximum flexibility with support for `assetDir` per language.

In practice this was a bad idea:

* You get duplication of identical content, with added processing time
* You end up with path issues that seem to be hard to find a way around (`@fa-font-path` is one example)

This commit changes that. Now there is only one `assetDir` and if you, as one example, need to generate a CSS per langugage, you need to set the paths yourself.

Fixes gohugoio#5017
@bep bep added Enhancement and removed Proposal labels Jul 31, 2018
@bep
Copy link
Member Author

bep commented Jul 31, 2018

Yea, I label it as an Enhancement -- but it was obviously a mistake once I started to actually use it.

bep added a commit to bep/hugo that referenced this issue Jul 31, 2018
With the newly released Hugo Pipes, resources fetched and processed via `resources.Get` and similar was published to the relevant language sub folder when in multilingual mode.

The thought behind that was maximum flexibility with support for `assetDir` per language.

In practice this was a bad idea:

* You get duplication of identical content, with added processing time
* You end up with path issues that seem to be hard to find a way around (`@fa-font-path` is one example)

This commit changes that. Now there is only one `assetDir` and if you, as one example, need to generate a CSS per langugage, you need to set the paths yourself.

Fixes gohugoio#5017
@bep bep closed this as completed in #5018 Jul 31, 2018
bep added a commit that referenced this issue Jul 31, 2018
With the newly released Hugo Pipes, resources fetched and processed via `resources.Get` and similar was published to the relevant language sub folder when in multilingual mode.

The thought behind that was maximum flexibility with support for `assetDir` per language.

In practice this was a bad idea:

* You get duplication of identical content, with added processing time
* You end up with path issues that seem to be hard to find a way around (`@fa-font-path` is one example)

This commit changes that. Now there is only one `assetDir` and if you, as one example, need to generate a CSS per langugage, you need to set the paths yourself.

Fixes #5017
@claudix
Copy link

claudix commented Mar 15, 2019

What if we use different hosting per language? (my case). I've noticed that the website relased under French language (hosted in server A) points to the JS/CSS files to the English website hosted in server B. I don't want to have host-dependency across sites. Is there any way to fall back to the previous behavior?

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants