]> git.maquefel.me Git - brevno-suite/hugo/commit
Fix some server rebuild issues for non-HTML custom output formats
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 23 Jan 2025 11:46:08 +0000 (12:46 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 24 Jan 2025 16:27:02 +0000 (17:27 +0100)
commitcd7dc7a37252b93799225af96cc011aaefdaa67f
tree593deb76f1751fdb8d57bbbd9b39d17c4a3d53c4
parentc939c33fd3dca9a2b21960866031b5ec9dad0123
Fix some server rebuild issues for non-HTML custom output formats

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
commands/hugobuilder.go
commands/server.go
common/types/evictingqueue.go
common/types/evictingqueue_test.go
hugolib/hugo_sites.go
hugolib/hugo_sites_build.go
hugolib/integrationtest_builder.go
hugolib/page__paths.go
hugolib/page__per_output.go
hugolib/rebuild_test.go
hugolib/site_render.go