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

Fix some server rebuild issues for non-HTML custom output formats #13304

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

bep
Copy link
Member

@bep bep commented Jan 24, 2025

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

@bep bep force-pushed the fix/watch-13014 branch 7 times, most recently from 9d57b38 to 5518fa0 Compare January 24, 2025 14:27
@bep bep marked this pull request as ready for review January 24, 2025 14:28
@bep bep force-pushed the fix/watch-13014 branch 2 times, most recently from 3ca6deb to cd0f9e2 Compare January 24, 2025 15:20
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 gohugoio#13014
@bep bep force-pushed the fix/watch-13014 branch from cd0f9e2 to d5e65f7 Compare January 24, 2025 15:33
@bep bep merged commit cd7dc7a into gohugoio:master Jan 24, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

watch not working on custom output template
1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy