Skip to content

Strip the version from Markdown self-links in versioned builds - #4061

Open
EliShteinman wants to merge 1 commit into
redis:mainfrom
EliShteinman:bugfix/versioned-markdown-self-links
Open

EliShteinman wants to merge 1 commit into
redis:mainfrom
EliShteinman:bugfix/versioned-markdown-self-links

Conversation

@EliShteinman

@EliShteinman EliShteinman commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #4060.

Problem

Since DOC-7086 converted RDI 1.19.1's archive to render-hook Markdown links, every link in that archive to another page of the same archive renders on redis.io as a literal href="/content/integrate/redis-data-integration/1.19.1/....md", which 404s. #4060 has examples.

The versioned build jobs strip the version from relref self-links before they move the version up one level and delete its directory. They don't strip it from ](/content/<product>/<version>/...) links, which then point at a page that no longer exists.

Change

In .github/workflows/main.yml, each of the four versioned jobs gets a second gsub in its existing awk (build_kubernetes, build_rs, build_rdi, build_redisvl). The new gsub rewrites ](/content/<product>/<version>/ to ](/content/<product>/, mirroring the one for relref.

Only the RDI archive has Markdown self-links today. The other three jobs get the same line so they don't break when their archives are converted.

Verification

  • All archives, three awks: Each of the four awk lines, exactly as written in the workflow, was run under awk (BWK), mawk (the ubuntu-latest default), and gawk. It ran against every archived version on main: 44 versions across the four products.
    • Afterwards, no version-prefixed self-link of either form is left.
    • RDI 1.19.1: 335 Markdown self-links go to 0.
    • The other archives have no Markdown self-links, so the new gsub doesn't change them.
  • Real version build: A sandboxed Hugo build of RDI 1.19.1 went through the same steps as the job: remove the other versions, run awk, run rsync --delete-after, run hugo.
    • With the current awk, the version's output had 44 href="/content/ links, from the DOC-7086 installation unit alone.
    • With the fix, it had 0.
    • RS 8.0, RS 7.4, Kubernetes 8.0.18, and RedisVL 0.27.1 had 0 with the fix too.

🤖 Generated with Claude Code


Note

Low Risk
CI-only preprocessing in the docs workflow; no runtime or auth changes, and the new rewrite mirrors an existing relref step.

Overview
Fixes broken internal links in versioned Hugo doc builds (Kubernetes, RS, RDI, RedisVL) where archived content uses render-hook Markdown paths like ](/content/.../<version>/...).

Each versioned job in .github/workflows/main.yml already rewrites relref shortlinks to drop the version segment before rsync flattens the version directory. This PR adds a matching awk gsub on the same pass so ](/content/<product>/<version>/ becomes ](/content/<product>/, in line with the existing relref behavior.

Comments in those four jobs are updated to note that both relrefs and Markdown links are normalized. RDI 1.19.1 is the archive that currently hits this (335 self-links); the other three products get the same rule so future archive conversions do not regress.

Reviewed by Cursor Bugbot for commit 65db02c. Bugbot is set up for automated code reviews on this repo. Configure here.

Each versioned build (Kubernetes, RS, RDI, RedisVL) moves the version's
content up one level and deletes the version directory, after stripping the
version from relref links only. DOC-7086 converted RDI 1.19.1's archive to
render-hook Markdown links (/content/<product>/<version>/...), which keep the
prefix, no longer resolve, and render as literal href="/content/..." 404s.

The second gsub rewrites that form the same way the first rewrites relrefs.
Checked with awk, mawk, and gawk against every archived version: no
version-prefixed link of either form is left, and the other products'
archives, which have no Markdown self-links yet, are unchanged by it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 19, 2026 18:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The four changes consistently mirror the existing relref rewrite and run before the version directory is flattened.

Review effort: Lite
Findings: None

What changed in this PR

Updates versioned Hugo build preprocessing so archived self-links no longer retain deleted version directories.

Changes:

  • Adds Markdown-link normalization to all four versioned build jobs.
  • Updates comments to document both normalized link formats.
File Description
.github/​workflows/​main.yml Normalizes versioned Markdown self-links before archive flattening.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

Archived RDI 1.19.1 pages link to /content/...md paths that 404

2 participants