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

Option to disable resources duplication #11995

Open
TiGR opened this issue Feb 5, 2024 · 4 comments
Open

Option to disable resources duplication #11995

TiGR opened this issue Feb 5, 2024 · 4 comments
Labels
Milestone

Comments

@TiGR
Copy link

TiGR commented Feb 5, 2024

There is a problem that page resources are being duplicated to all the languages. This is going to be fixed in 0.123, but only for markdown (could be enabled as an option for goldmark renderer)

Here is an example site that shows the issue. There are 2 pages named test and test2. Both pages are translated into 2 languages. Translations in test page are in markdown format. Translations in test2 are in html format (while original language is still in markdown).

In hugo 0.122 and prior versions resources for both pages are being duplicated into all languages. In hugo 0.123 they are duplicated only if the translations are non-markdown pages. In the example above site test page resources are not duplicated, but for test2 they are.

This behavior seems to be a bit counter-intuitive, since resource duplication depends on source translation file format. Also, there is no way to disable this.

I think that there should be some option, that would control resource duplication for translations, and it should not be format-dependent.

In our case it creates a lot of problems. Our website that is 4,5Gb for main language and it is translated into 11 additional languages, and since translations are all in html files, all the resources (even not used ones) are being copied and duplicated int all the languages. So, the entire website ends up in 33Gb. If we remove all the duplicated resources, this number drops to 6,5Gb.

Building and deploying 33Gb is very resource-intensive, and our pipelines (that include publishing) run not for minutes, but for over an hour.

Having this fixed is really critical for us, and we were eagerly anticipating 0.123, but it does not solve our problems.

@bep bep removed the NeedsTriage label Feb 6, 2024
@bep bep added this to the v0.124.0 milestone Feb 6, 2024
@bep
Copy link
Member

bep commented Feb 6, 2024

I agree that we should fix this, but it will not happen in v0.123.0. We are more or less ready for a release (the documentation is written etc.) and we don't want to introduce some last minute surprise (I'm sure there are enough of those without us having to introduce them).

@jmooring
Copy link
Member

jmooring commented Feb 6, 2024

I understand the point you raise, but I want to clarify this statement for anyone else who stumbles across this:

resource duplication depends on source translation file format. Also, there is no way to disable this.

You can disable the format-dependent behavior with:

markup:
  goldmark:
    duplicateResourceFiles: true

I know that doesn't solve your problem, but it provides uniform behavior for anyone who needs/wants it.

@TiGR
Copy link
Author

TiGR commented Feb 6, 2024

Also, I thinks that this option to duplicate resources could (optionally) be moved down to page level. For instance, we might want to disable this behavior globally and then enable it for a section or a specific page via frontmatter flags.

@bep bep modified the milestones: v0.124.0, v0.125.0 Mar 4, 2024
@TiGR
Copy link
Author

TiGR commented May 31, 2024

@bep

I agree that we should fix this, but it will not happen in v0.123.0

So... Could it be fixed in v0.127.0?

@jmooring

You can disable the format-dependent behavior with:

The problems is, that due to the way we do the translations, all translation pages are not in markdown format, but in HTML. So, there seems to be no way to disable this behavior.

And possibly it could have be controlled from a single configuration point, since this is not semantically related the transformation of content pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants