Fix "Edit page" link on stub pages and hide it on search pages#405
Merged
Conversation
Thin product stubs (1 @includes import + 1 JSX call) now route the "Edit page" link to the shared _includes file where the prose lives, instead of the stub the reader can't meaningfully edit. Composition pages with their own structure are unaffected. Also disables the link on the 13 per-product Search Results pages, which have no editable prose, and normalizes the two mobile/releases stubs to the canonical `@includes/...` import shape.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@includes/...import and 1 JSX component call) now point the "Edit page" link at the shared_includes/...mdxfile where the prose actually lives, instead of the thin stub the reader can't meaningfully edit. Detection runs in the existing route middleware, reads each source file at most once (cached perfilePath), and adds ~40 ms to a full build (3205 files × ~13 µs).@includesimports or multiple JSX calls (e.g. PE / Trendz install guides that fan a single include into many<DockerSection section="…" />calls) are left alone — their structure lives in the stub itself.editUrl: falseto the 13 per-product Search Results pages, which render only a search widget and have no editable prose.mobile/releasesstubs from~/content/_includes/...to the canonical@includes/...import shape so the stub-detection regex stays single-pattern.