Skip to content

Limit deploy previews to mounted docs roots - #1477

Draft
jdbaldry wants to merge 7 commits into
mainfrom
jdb/deploy-preview
Draft

Limit deploy previews to mounted docs roots#1477
jdbaldry wants to merge 7 commits into
mainfrom
jdb/deploy-preview

Conversation

@jdbaldry

@jdbaldry jdbaldry commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

What

  • Keep deploy preview docs navigation scoped to mounted content only.
  • Derive mounted top-level docs roots from SOURCES and remove other /hugo/content/docs/* trees before Hugo build.
  • Add title and menuTitle to generated redirect index pages so root sections have labels.

Testing

  • Validated against grafana/mcp-doc-server PR 36 with toolkit_ref set to jdb/deploy-preview.
  • Before: sidebar included unrelated product trees and blank labels.
  • After: sidebar contains only the mounted mcp-doc-server tree and zero empty docs menu anchors.

@github-actions

Copy link
Copy Markdown
Contributor

Readability report

File AutomatedReadability ColemanLiau FleschKincaid FleschReadingEase GunningFog LIX SMOG
docs/sources/whats-new.md $${9.69\space\color{black}(Δ+0.00)}$$ $${13.09\space\color{black}(Δ+0.00)}$$ $${9.74\space\color{black}(Δ+0.00)}$$ $${46.61\space\color{black}(Δ+0.00)}$$ $${11.47\space\color{black}(Δ+0.00)}$$ $${70.33\space\color{black}(Δ+0.00)}$$ $${11.21\space\color{black}(Δ+0.00)}$$
View metric targets
Metric Range Ideal score
AutomatedReadability 6 (very easy read) to 14 (extremely difficult read) 8 or less
ColemanLiau 6 (very easy read) to 17 (extremely difficult read) 9 or less
FleschKincaid 6 (very easy read) to 17 (extremely difficult read) 8 or less
FleschReadingEase 100 (very easy read) to 0 (extremely difficult read) 70 or more
GunningFog 6 (very easy read) to 17 (extremely difficult read) 10 or less
LIX 20 (very easy read) to 60+ (extremely difficult read) 35 or less
SMOG 6 (very easy read) to 17 (extremely difficult read) 10 or less

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

💻 Deploy preview available (Serve redirects in deploy previews from the Hugo manifest):

jdbaldry added 2 commits July 24, 2026 21:42
grafana/website#32512 replaces client-side alias pages with a
generated redirects manifest.
Previews serve dist directly, so without rewrites alias URLs would
404 once that change ships in docs-base.

Generate dist/preview-redirects.conf after the Hugo build with the
redirects binary already present in the docs-base image, and include
it in the preview nginx server block.
Older images have a redirects binary without the --manifest option,
so fall back to scraping dist for alias pages, which preserves
current behaviour.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Allows callers to test preview builds against docs-base images
published from grafana/website pull requests with the
build-docs-base label.
The login only runs for us-docker.pkg.dev images and requires
id-token permission from the caller, which the writers-toolkit
caller already grants.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
@jdbaldry
jdbaldry force-pushed the jdb/deploy-preview branch from bf6797a to efb76aa Compare July 24, 2026 20:42
@jdbaldry
jdbaldry marked this pull request as ready for review July 24, 2026 20:44
@jdbaldry
jdbaldry requested a review from a team as a code owner July 24, 2026 20:44
Some interactive-tutorials paths omit layout in website.yaml, which makes deploy previews render in the default docs layout instead of the learning path layout.
This adds a fallback in build-interactive-tutorials that writes layout: single-journey when website.yaml is missing or does not define layout.
I did not change existing website.yaml values because preview generation should be resilient to incomplete package metadata.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
@jdbaldry
jdbaldry marked this pull request as draft August 13, 2026 10:16
@jdbaldry jdbaldry changed the title Serve redirects in deploy previews from the Hugo manifest Limit deploy previews to mounted docs roots Aug 13, 2026
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
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.

1 participant