davsclaus opened a new pull request, #1779:
URL: https://github.com/apache/camel-website/pull/1779

   Replaces #1778, which GitHub closed when its base branch (#1777) was merged 
and deleted; same commit, rebased onto `main`.
   
   ## Why
   
   Inside the Markdown mirrors, links between website pages and blog posts are 
directory links: `[Camel DNA](../camel-dna/)`, `[Built to Patch 
Fast](../blog/2026/07/camel-security-advisories-4.21.0/)`. A reader following 
one lands on the HTML page: the full page with header, navigation and scripts, 
roughly ten times the tokens of the mirror, and not necessarily readable to a 
text-only fetcher. Documentation links already get `.html` rewritten to `.md` 
for exactly this reason; directory links were simply not covered.
   
   ## What
   
   - `rewriteDirectoryLinks(markdown, pagePath, hasMirror)` in 
`convert-page.js` appends `index.md` to a relative, root-relative or 
`https://camel.apache.org/` directory link (fragment preserved: 
`../trust/#security` → `../trust/index.md#security`) when the target has a 
mirror. Links to list pages (`../download/`), version redirects 
(`../camel-quarkus/latest/`) and external sites are untouched.
   - `generate-markdown.js` runs it over the generated `index.md` files after 
the conversion loop, when the set of mirrors is known. 148 files change; 
documentation pages are not touched (they use `.html` links, already handled).
   - Two tests: the rewrite matrix, and resolution relative to the carrying 
page.
   
   Verification: `yarn test` 23 pass; `yarn build:markdown` — 
`what-is-apache-camel/index.md` now links `../camel-dna/index.md`, 
`../when-to-use/index.md`, `../community/user-stories/index.md`, 
`../components/next/index.md`, while `../camel-quarkus/latest/` stays as is.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to