Repository navigation
fix(seo): disallow /hugo-preview/ in root robots.txt - #8332
Conversation
Signed-off-by: PARTH-TUSSLE <parthgartan26feb@gmail.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
carlosriosilva
left a comment
There was a problem hiding this comment.
Nice work - a clean one-line fix with a clear explanation of why it matters.
What stood out:
- Previews live under the root domain, so crawlers read the root robots.txt from the default branch - adding /hugo-preview/ next to /pr-preview/ closes that gap exactly where it needs closing.
- The change is minimal and the reasoning in the PR body is clear.
No changes needed from me - approving.
hortison
left a comment
There was a problem hiding this comment.
Approved. Checked:
- Full diff: one line in gatsby-config.js, adds "/hugo-preview/" to the robots.txt disallow list alongside "/pr-preview/".
- Linked issue #8330 asks for exactly this change and confirms Hugo previews are served from the production origin at layer5.io/hugo-preview/pr-/, where only the root robots.txt counts.
- gatsby-plugin-robots-txt is the plugin behind this config (referenced in gatsby-config.js and package.json); the /hugo-preview/ path is confirmed in .github/workflows/deploy-hugo-preview.yml.
- Checks on head a4e3809 are all green: build, CodeRabbit, triage, DCO success; Handle Copilot PR skipped. The CI build passing covers the config change.
- CodeRabbit review found no actionable comments; no prior reviews and no unresolved review threads.
- Change is minimal, matches the issue exactly, and keeps the site root allowed while excluding the ephemeral preview paths.
|
Preview removed because the pull request was closed. |
Part of #8330
/hugo-preview/in production rootrobots.txtgenerated by Gatsby onmasterSummary
Updates
gatsby-config.jsto include"/hugo-preview/"inpolicy.disallowalongside"/pr-preview/".Because previews are served from the root domain (
https://layer5.io/hugo-preview/pr-<N>/), web crawlers check the roothttps://layer5.io/robots.txtserved from the default branch. This one-line change ensures that production Gatsby builds immediately instruct search engines not to crawl ephemeral Hugo previews.Diff
Summary by CodeRabbit
/pr-preview/and/hugo-preview/paths, while the site root remains allowed.