summaryrefslogtreecommitdiffstats
path: root/hugolib
Commit message (Collapse)AuthorAge
* Fix it so the owning taxonomy gets rerendered in server when new tags are addedHEADmasterBjørn Erik Pedersen2 days
| | | | Updates #13648
* hugolib: Use new build key in content placeholderJoe Mooring3 days
| | | | Fixes #13655
* config: Fix _merge issue when key doesn't exist on the left sideBjørn Erik Pedersen6 days
| | | | | Fixes #13643 Fixes #13646
* all: Fix typosChristian Oliff7 days
|
* Revert the breaking change from 0.146.0 with dots in content filenamesBjørn Erik Pedersen8 days
| | | | Closes #13632
* tpl: Fix indeterminate template lookup with templates with and without langBjørn Erik Pedersen8 days
| | | | Close #13636
* tpl: Detect and fail on infinite template recursionBjørn Erik Pedersen9 days
| | | | Fixes #13627
* tpl: Fix language handling in partialsBjørn Erik Pedersen2025-04-15
| | | | | | We now use the same code path for all templates re this. Fixes #13612
* tpl: Fix the case for a shortcode in a nested folder onlyBjørn Erik Pedersen2025-04-14
| | | | Fixes #13605
* tpl: Make any layout set in front matter higher priorityBjørn Erik Pedersen2025-04-12
| | | | Fixes #13541
* tpl: Warn and skip non-hook templates inside /layouts/_markupBjørn Erik Pedersen2025-04-10
| | | | Fixes #13577
* tpl: Add a partial lookup cacheBjørn Erik Pedersen2025-04-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ```` │ stash.bench │ perf-v146.bench │ │ sec/op │ sec/op vs base │ LookupPartial-10 248.00n ± 0% 14.75n ± 2% -94.05% (p=0.002 n=6) │ stash.bench │ perf-v146.bench │ │ B/op │ B/op vs base │ LookupPartial-10 48.00 ± 0% 0.00 ± 0% -100.00% (p=0.002 n=6) │ stash.bench │ perf-v146.bench │ │ allocs/op │ allocs/op vs base │ LookupPartial-10 3.000 ± 0% 0.000 ± 0% -100.00% (p=0.002 n=6) ``` THe speedup above assumes reuse of the same partials over and over again, which I think is not uncommon. This commits also adds some more lookup benchmarks. The current output of these on my MacBook looks decent: ``` BenchmarkLookupPagesLayout/Single_root-10 3031562 395.5 ns/op 0 B/op 0 allocs/op BenchmarkLookupPagesLayout/Single_sub_folder-10 2515915 480.9 ns/op 0 B/op 0 allocs/op BenchmarkLookupPartial-10 84808112 14.13 ns/op 0 B/op 0 allocs/op BenchmarkLookupShortcode/toplevelpage-10 8111779 148.2 ns/op 0 B/op 0 allocs/op BenchmarkLookupShortcode/nestedpage-10 8088183 148.6 ns/op 0 B/op 0 allocs/op ``` Note that in the above the partial lookups are cahced, the others not (they are harder to cache because of the page path). Closes #13571
* tpl: Add templates.CurrentBjørn Erik Pedersen2025-04-09
| | | | | | | | | | | This commit also * Unexport all internal state in TemplateInfo. * Make the dispatcher keys used for passing context.Context into uint8 from string to save memory allocations. Co-authored-by: Joe Mooring <joe@mooring.com> Updates #13571
* Reimplement and simplify Hugo's template systemBjørn Erik Pedersen2025-04-06
| | | | | | | | | | | See #13541 for details. Fixes #13545 Fixes #13515 Closes #7964 Closes #13365 Closes #12988 Closes #4891
* all: Typo fixescoliff2025-02-26
|
* Use the page path and not the backing filename as the last resort in the ↵Bjørn Erik Pedersen2025-02-26
| | | | | | | | | default sort This should: 1. Fix some (rare) tiebreaker issues when sorting pages from multiple content adapters. 2. Improve the sorting for pages without a backing file.
* all: Run modernize -fix ./...Bjørn Erik Pedersen2025-02-26
|
* Fix some related content issues with content adaptersBjørn Erik Pedersen2025-02-25
| | | | Fixes #13443
* hugolib: Deprecate _build front matter key in favor of buildJoe Mooring2025-02-24
| | | | | We effectively aliased "_build" to "build" in v0.123.0, and removed "_build" from the documentation at the same time.
* Fix --printPathWarnings when site calls templates.DeferBjørn Erik Pedersen2025-02-19
| | | | | | This issue was introduced recently in eb7a5aabaaa025b6633b4aff3267b21ebdffb8e9. Fixes #13420
* Fix auto generated header ids so they don't contain e.g. hyperlink ↵Bjørn Erik Pedersen2025-02-17
| | | | | | | | | | | destinations (note) This makes the header ids match the newly added dt ids. Also make sure newlines are preserved in hooks' `.PlainText`. Fixes #13405 Fixes #13410
* Support menus as maps in content adaptersBjørn Erik Pedersen2025-02-13
| | | | Fixes #13384
* Deprecate kind, lang, and path from front matterBjørn Erik Pedersen2025-02-10
| | | | | | | | These were added to the page meta object when we implemented "pages from data", but were not meant to be used in front matter. That is not supported, so we might as well add validation. Fixes #12484
* Add ContentTypes to configBjørn Erik Pedersen2025-02-08
| | | | | | | | | | | | | This is an empty struct for now, but we will most likely expand on that. ``` [contentTypes] [contentTypes.'text/markdown'] ``` The above means that only Markdown will be considered a content type. E.g. HTML will be treated as plain text. Fixes #12274
* Move "print unused templates" after renderDeferredBjørn Erik Pedersen2025-02-07
| | | | Fixes #13355
* Fix shortcode name in error message on self-closing shortcodes with no .InnerBjørn Erik Pedersen2025-02-05
| | | | Fixes #13344
* Fix RSS with baseURL with sub dir when render hooks is enabledBjørn Erik Pedersen2025-02-03
| | | | Fixes #13332
* Re-introduce the LRU-evicted identities in change set calculationBjørn Erik Pedersen2025-02-02
| | | | | | | | This is a follow up to db28695ff505f84aee69c72dcc9e192f674c86a1 -- that commit dropped the cache items evicted in the LRU process. This was done as performance optimization for large Hugo sites. That made much sense, but now there's a slight chance that we miss out on a change when rebuilding. This commit fixes this by applying the same logic to the evicted items as if they were still in the cache. This should preserve the performance gains in db28695ff505f84aee69c72dcc9e192f674c86a1 and close the hole for the possible false negatives.
* Fix some server/watch rebuild issuesBjørn Erik Pedersen2025-02-01
| | | | | | | | | | | | | | | | | | | | | Two issues: 1. Fixe potential edit-loop in server/watch mode (see below) 2. Drain the cache eviction stack before we start calculating the change set. This should allow more fine grained rebuilds for bigger sites and/or in low memory situations. The fix in 6c68142cc1338640e2bfe2add661a7b4d7bee6ab wasn't really fixing the complete problem. In Hugo we have some steps that takes more time than others, one example being CSS building with TailwindCSS. The symptom here is that sometimes when you: 1. Edit content or templates that does not trigger a CSS rebuild => Snappy rebuild. 2. Edit stylesheet or add a CSS class to template that triggers a CSS rebuild => relatively slow rebuild (expected) 3. Then back to content editing or template edits that should not trigger a CSS rebuild => relatively slow rebuild (not expected) This commit fixes this by pulling the dynacache GC step up and merge it with the cache buster step. Fixes #13316
* Don't re-render aliases on server rebuildsBjørn Erik Pedersen2025-02-01
| | | | | | This can lead to stale aliases when rebuilding, but that's a trade-off we need to take for snappier rebuilds on bigger sites. Note that it should be possible to detect alias changes, but I'm not sure it's worth it.
* Fix TailwindCSS related server rebuild issueBjørn Erik Pedersen2025-01-29
| | | | Fixes #13316
* Fix some server rebuild issues for non-HTML custom output formatsBjørn Erik Pedersen2025-01-24
| | | | | | | | | | | | | | | | | | | | The failing test case here is * A custom search output format defined on the home page, marked as `noAlternative` and not `permalinkable` * In fast render mode, when making a change to a data source for that search output format, the JSON file was not refreshed. There are variants of the above, but the gist of it is: * The change set was correctly determined, but since the search JSON file was not in the recently visited browser stack, we skipped rendering it. Running with `hugo server --disableFastRender` would be a workaround for the above. This commit fixes this by: * Adding a check for the HTTP request header `Sec-Fetch-Mode = navigation` to the condition for if we should track server request as a user navigation (and not e.g. a HTTP request for a linked CSS stylesheet). * Making sure that we compare against the real relative URL for non-permalinkable output formats. Fixes #13014
* Fix cascade with overlapping sectionsBjørn Erik Pedersen2025-01-24
| | | | Fixes #12465
* tpl/tplimpl: Improve shortcode test coverageJoe Mooring2025-01-24
|
* Make cascade front matter order deterministicBjørn Erik Pedersen2025-01-23
| | | | Fixes #12594
* resources: Fix 2 image file cache key issuesBjørn Erik Pedersen2025-01-18
| | | | | | | | | | | | * Always include the content hash in the cache key for unprocessed images. * Always include the image config hash in the cache key. This is also a major cleanup/simplification of the implementation in this area. Note that this, unfortunately, forces new hashes/filenames for generated images. Fixes #13273 Fixes #13272
* tpl/tplimpl: Deprecate twitter shortcode in favor of x shortcodeJoe Mooring2025-01-16
| | | | Closes #13214
* For render hooks, only fallback to HTML (or the defaultOutputFormat) templateBjørn Erik Pedersen2025-01-15
| | | | Closes #13242
* tpl/tplimpl: Use plain text for image render hook alt attributeJoe Mooring2025-01-10
| | | | Co-authored-by: Heracles <email@heracl.es>
* Adjust error handling in ToMath vs try (note)Bjørn Erik Pedersen2025-01-09
| | | | Closes #13239
* Fix branch resource overlapping bundle pathBjørn Erik Pedersen2025-01-09
| | | | Fixes #13228
* templates: Fix handling of multiple defers in the same templateBjørn Erik Pedersen2025-01-09
| | | | Fixes #13236
* images: Rework the golden testsBjørn Erik Pedersen2025-01-08
|
* Fix NPX issue with TailwindCSS v4Bjørn Erik Pedersen2025-01-07
| | | | | | This allows the `tailwindcss` CLI binary to live in the `PATH` for NPM-less projects. Fixes #13221
* resources: Replace error handling in GetRemote with try (note)Bjørn Erik Pedersen2025-01-06
| | | | Closes #13216
* Fix server refresh on 404 template changesBjørn Erik Pedersen2025-01-02
| | | | Fixes #13209
* hugolib: Fix fallbacks for menu entry Name and TitleJoe Mooring2024-12-19
| | | | Closes #13161
* Fix panic on server rebuilds when using both base templates and template.DeferBjørn Erik Pedersen2024-12-16
| | | | Fixes #12963
* js: Fix js.Batch for multihost setupsBjørn Erik Pedersen2024-12-16
| | | | | | Note that this is an unreleased feature. Fixes #13151
* Fix a rebuild on resource rename caseBjørn Erik Pedersen2024-12-16
|