DOC-6909 Add link and blockquote render hooks to replace relref - #3797
Open
andy-stark-redis wants to merge 1 commit into
Open
DOC-6909 Add link and blockquote render hooks to replace relref#3797andy-stark-redis wants to merge 1 commit into
andy-stark-redis wants to merge 1 commit into
Conversation
Contributor
Contributor
🧠 Redis MemoryFound 8 related items from repository history:
Memory updated at 224e895 |
andy-stark-redis
force-pushed
the
DOC-6909-3-render-hooks
branch
from
August 12, 2026 15:01
ae42f07 to
201e5cc
Compare
andy-stark-redis
marked this pull request as ready for review
August 12, 2026 15:01
andy-stark-redis
force-pushed
the
DOC-6909-3-render-hooks
branch
from
August 12, 2026 15:25
201e5cc to
3e4ed01
Compare
andy-stark-redis
marked this pull request as draft
August 12, 2026 15:26
Adds the two render hooks the investigation set out to evaluate, plus the assessment recording the evidence. No content is migrated here; relref and plain Markdown links coexist, so this changes no page's authoring. Installing the link hook is nonetheless the atomic event, not the content conversion: the hook is global and reprocesses every pre-existing plain link on the site, applying benign normalisation. That is why this lands as its own change with whole-site parity evidence behind it. Several parts of the link hook are load-bearing and were each established by a corpus-scale failure. The placeholder guard passes unsubstituted shortcodes through untouched, because goldmark runs before shortcode substitution and without it every un-migrated relref becomes a spurious unresolved warning; it can only be removed once relref is gone. External links are detected with findRE rather than urls.Parse, which hard-errors on malformed destinations and fails the whole build. Resolution uses PageInner so transcluded content resolves against the page whose Markdown holds the link. Anchors split on the first hash only, and the composed href needs safeURL or Go emits ZgotmplZ. Page-bundle resources are tried before warning, for the companion source files the use-case demos link. The blockquote hook reproduces the existing callout styling for the native alert syntax, and leaves ordinary blockquotes byte-identical to Hugo's default. It is a prerequisite for relative links inside callouts, because the callout shortcodes render their inner content through markdownify, which has no page context. Ticket: DOC-6909 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
andy-stark-redis
force-pushed
the
DOC-6909-3-render-hooks
branch
from
August 12, 2026 15:32
3e4ed01 to
224e895
Compare
andy-stark-redis
marked this pull request as ready for review
August 12, 2026 15:45
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.
Part 3 of 4. Stack: #3795 → #3796 → #3797 (this) → #3798
What this is
The two render hooks the investigation set out to evaluate, plus
HUGO_DEPENDENCY_ASSESSMENT.mdrecording the evidence. No content is migrated here —relrefand plain Markdown links coexist, so no page's authoring changes.Why this is the risky one
Installing the link hook is the atomic event, not the content conversion. The hook is global and reprocesses every pre-existing plain link on the site (~31k), applying benign normalisation. That's why it lands as its own reviewable change.
Load-bearing details
Each of these was established by a corpus-scale failure, and quietly removing any of them will break something:
relrefis still aHAHAHUGOSHORTCODEplaceholder at hook time. Without the guard, ~26,800 spurious "unresolved" warnings bury the real ones. Remove it only oncerelrefis gone.findREnoturls.Parsefor external detection —urls.Parsehard-errors on malformed destinations and fails the entire build..PageInnerso transcluded content resolves against the page whose Markdown holds the link.#-only anchor split, andsafeURLon the composed href or Go emitsZgotmplZ. Hugo has nostrings.Index.The blockquote hook reproduces existing callout styling for native
> [!NOTE]syntax and leaves ordinary blockquotes byte-identical to Hugo's default. It's a prerequisite for relative links inside callouts, because the callout shortcodes render inner content throughmarkdownify, which has no page context.Known: one warning on current
main0.24.0and0.25.0of the synced RedisVL docs use a relativemcp.md#…link on pages that render viamarkdownify, so the hook resolves them against the site root and warns. The target file exists — this is not a dead link, it's themarkdownifycontext problem. The older copies were fixed withrelrefin #3795; the durable fix is inbuild/redisvl_docs_sync.py.Note
High Risk
The link hook is global and reprocesses every existing plain Markdown link on build; regressions in resolution, warnings, or malformed-URL handling can break the site build or silently change hrefs across ~31k links.
Overview
Introduces Hugo markup render hooks so docs can move off
relrefand callout shortcodes toward portable Markdown, and documents the full migration strategy inHUGO_DEPENDENCY_ASSESSMENT.md. Nocontent/changes in this PR—relrefand plain links coexist during rollout.The
render-linkhook resolves internal Markdown links to published permalinks (parity-tested againstrelref), normalises existing plain links site-wide, and includes corpus-scale safeguards: arelrefplaceholder guard, external detection viafindRE(noturls.Parse),.PageInnerresolution for mounts/transclusion, first-#-only anchor splitting withsafeURL, and page-bundle resource fallback before warnings.The
render-blockquotehook maps> [!NOTE]/> [!WARNING](etc.) to the same alert UI as today’s shortcodes while leaving normal blockquotes unchanged; alert bodies render as native Markdown so links inside callouts get correct page context (unlikemarkdownifyin shortcodes).Reviewed by Cursor Bugbot for commit 224e895. Bugbot is set up for automated code reviews on this repo. Configure here.