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

.File.Lang will only have a value if the file is configured with one #9355

Closed
bep opened this issue Jan 5, 2022 · 1 comment
Closed

.File.Lang will only have a value if the file is configured with one #9355

bep opened this issue Jan 5, 2022 · 1 comment
Assignees
Milestone

Comments

@bep
Copy link
Member

bep commented Jan 5, 2022

This relates to #9343 -- and it relates to some cleanups I'm doing in this department.

Currently, when doing a .File.Lang you will always get a lang. After this change, you will only get a .Lang if the file is configured with it (either in the filename or the file mount).

We need less magic in Hugo.

Note that $page.Lang will still always get a value.

@bep bep added the Proposal label Jan 5, 2022
@bep bep added this to the v0.93.0 milestone Jan 5, 2022
@bep bep self-assigned this Jan 5, 2022
bep added a commit to bep/hugo that referenced this issue Jan 5, 2022
TODO(bep) improve commit message.

Hugo has always been a active user of in-memory caches, but before this commit we did nothing to control the memory usage.

One failing example would be loading lots of big JSON data files and unmarshal them via `transform.Unmarshal`.

This commit consolidates all these caches into one single LRU cache with an eviction strategy that also considers used vs. available memory.

Hugo will try to limit its memory usage to 1/4 or total system memory, but this can be controlled with the `HUGO_MEMORYLIMIT` environment variable (a float value representing Gigabytes).

A natural next step after this would be to use this cache for `.Content`.

Fixes gohugoio#8307
Fixes gohugoio#8498
Fixes gohugoio#8927
Fixes gohugoio#9192
Fixes gohugoio#9189
Fixes gohugoio#7425
Fixes gohugoio#7437
Fixes gohugoio#7436
Fixes gohugoio#7882
Updates gohugoio#7544
Fixes gohugoio#9224
Fixes gohugoio#9324
Fixes gohugoio#9352
Fixes gohugoio#9355
Fixes gohugoio#9343
bep added a commit to bep/hugo that referenced this issue Jan 9, 2022
TODO(bep) improve commit message.

Hugo has always been a active user of in-memory caches, but before this commit we did nothing to control the memory usage.

One failing example would be loading lots of big JSON data files and unmarshal them via `transform.Unmarshal`.

This commit consolidates all these caches into one single LRU cache with an eviction strategy that also considers used vs. available memory.

Hugo will try to limit its memory usage to 1/4 or total system memory, but this can be controlled with the `HUGO_MEMORYLIMIT` environment variable (a float value representing Gigabytes).

A natural next step after this would be to use this cache for `.Content`.

Fixes gohugoio#8307
Fixes gohugoio#8498
Fixes gohugoio#8927
Fixes gohugoio#9192
Fixes gohugoio#9189
Fixes gohugoio#7425
Fixes gohugoio#7437
Fixes gohugoio#7436
Fixes gohugoio#7882
Updates gohugoio#7544
Fixes gohugoio#9224
Fixes gohugoio#9324
Fixes gohugoio#9352
Fixes gohugoio#9355
Fixes gohugoio#9343
@bep bep closed this as completed Jan 9, 2022
@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 Jan 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant