Skip to content

fix: resolve relative markdown links in render hook#998

Merged
imfing merged 3 commits into
mainfrom
enhance-997-behavior
May 25, 2026
Merged

fix: resolve relative markdown links in render hook#998
imfing merged 3 commits into
mainfrom
enhance-997-behavior

Conversation

@imfing
Copy link
Copy Markdown
Owner

@imfing imfing commented May 21, 2026

Summary

  • Resolve local Markdown links like ./page.md, ../page.md, and /docs/page.md through Hugo page lookup before falling back to existing absolute-path, resource, and static handling.
  • Resolve relative Markdown paths from the current content file directory so both regular content files and leaf page bundles rewrite to clean Hugo URLs.
  • Preserve query strings, fragments, missing links, and external link behavior.
  • Add a regression test that builds a temporary Hugo site and verifies regular-page links, leaf-bundle links, absolute Markdown links, missing links, and external links.

Testing

  • git diff --check
  • npx playwright test tests/render-link.spec.ts
  • npm run build
  • npm test

@imfing imfing temporarily deployed to accessibility May 21, 2026 21:12 — with GitHub Actions Inactive
@netlify
Copy link
Copy Markdown

netlify Bot commented May 21, 2026

Deploy Preview for hugo-hextra ready!

Name Link
🔨 Latest commit 55026db
🔍 Latest deploy log https://app.netlify.com/projects/hugo-hextra/deploys/6a1392d58b913d0008e30867
😎 Deploy Preview https://deploy-preview-998--hugo-hextra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@imfing imfing linked an issue May 21, 2026 that may be closed by this pull request
@imfing imfing temporarily deployed to accessibility May 25, 2026 00:07 — with GitHub Actions Inactive
@imfing imfing marked this pull request as ready for review May 25, 2026 00:10
@imfing imfing added this to the v0.13.0 milestone May 25, 2026
@imfing imfing merged commit c73479e into main May 25, 2026
6 checks passed
@imfing imfing deleted the enhance-997-behavior branch May 25, 2026 00:11
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.

render-link: relative .md links not rewritten to Hugo clean URLs

1 participant