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: Remove redirect_facility to fix broken redirects #678

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

Techassi
Copy link
Member

@Techassi Techassi commented Nov 14, 2024

Fixes stackabletech/crddocs#44

This came up in stackabletech/crddocs#44. Initial investigation revealed that the roles-and-role-groups.html file was not present in the stable (24.7) and nightly (soon 24.11) version of generated files when using the production antor playbook.

This playbook is used when Netlify deploys the docs using make netlify-build. Local builds using make on the other hand included the file in both versions and as such, the redirect works.

Finally, the redirect_facility: netlify option was identified as the cause. The generated _redirects file only contained a redirect from concepts/roles-and-role-groups.html to concepts/stacklet.html. This matched with the behaviour we experiences when surfing the live site.

Removing this option (and thus using the default facility) potentially fixes the issue. Netlify already provides redirect using the "Pretty URLs" post-processing feature.

References:

This came up in stackabletech/crddocs#44.
Initial investigation revealed that the roles-and-role-groups.html
file was not present in the stable (24.7) and nightly (soon 24.11)
version of generated files when using the production antor playbook.

This playbook is used when Netlify deploys the docs using 'make
netlify-build'. Local builds using 'make' on the other hand included
the file in both versions and as such, the redirect works.

Finally, the 'redirect_facility: netlify' option was identified as
the cause. The generated '_redirects' file only contained a redirect
from concepts/roles-and-role-groups.html to concepts/stacklet. This
matched with the behaviour we experiences when surfing the live site.

Removing this option (and thus using the default facility) potentially
fixes the issue. Netlify already provides redirect using the "Pretty
URLs" post-processing feature.

References:

- https://docs.antora.org/antora/latest/playbook/urls-redirect-facility/#redirect-facility-key
- https://docs.netlify.com/site-deploys/post-processing/#post-processing-features
- https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file
@Techassi Techassi self-assigned this Nov 14, 2024
Copy link

netlify bot commented Nov 14, 2024

Deploy Preview for stackable-docs ready!

Name Link
🔨 Latest commit 8daa911
🔍 Latest deploy log https://app.netlify.com/sites/stackable-docs/deploys/67361048e1fad20008cf3baa
😎 Deploy Preview https://deploy-preview-678--stackable-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

NickLarsenNZ
NickLarsenNZ previously approved these changes Nov 14, 2024
Copy link
Member

@NickLarsenNZ NickLarsenNZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (if the preview works)

@Techassi Techassi marked this pull request as ready for review November 14, 2024 15:05
Copy link
Member

@NickLarsenNZ NickLarsenNZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I suggest we let the team know in case anyone spots an issue with it.

@Techassi Techassi added this pull request to the merge queue Nov 14, 2024
Merged via the queue into main with commit 27e4fcd Nov 14, 2024
7 checks passed
@Techassi Techassi deleted the fix/broken-redirects branch November 14, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Broken link
2 participants