Skip to content

Resolve docs links under a non-root base (Step 1 of #507) - #508

Merged
em3s merged 1 commit into
mainfrom
docs/issue-507-base-aware-links
Oct 14, 2026
Merged

em3s merged 1 commit into
mainfrom
docs/issue-507-base-aware-links

Conversation

@em3s

@em3s em3s commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Summary

The docs are moving to kakao.github.io/actionbase/ (#507), so the site has to work under base: '/actionbase/'. Astro doesn't prefix base onto root-relative URLs in Markdown, components, or redirect destinations. Built with the new SITE_URL, starlight-links-validator fails on every ](/...) link, and the favicon, directory cards, and stories/* redirects point outside the site.

This PR makes all of those follow base. Nothing changes on actionbase.io because base is still / there. The actual switch is the next step.

Part of #507

Changes

  • Add plugins/remark-base-path.mjs to prefix base onto root-relative link/image/definition URLs and MDX href/src. It runs before starlight-links-validator, so validation sees the final URLs
  • Prefix base onto redirects destinations
  • Use import.meta.env.BASE_URL in DirectoryList, CategoryDirectoryList, and the favicon in Head.astro
  • Move the 404 "Go home" link from the hero action into the body, because Starlight passes hero link through as-is

How to Test

cd website
SITE_URL=https://kakao.github.io/actionbase/ npm run build
grep -rhoE '(href|src)="/[^"]*"' --include=*.html dist | grep -v '="/actionbase/'   # no output
npm run build   # base '/', output unchanged
npm run lint && npm run format:check

AI Assistance

  • This PR was written largely with AI assistance.
    • Tool / model: Claude Code (Claude Opus 5.5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@em3s

em3s commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

Optimistic

@em3s
em3s merged commit f1442df into main Oct 14, 2026
4 checks passed
@em3s
em3s deleted the docs/issue-507-base-aware-links branch October 14, 2026 01:55
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