marko-js / marko

A declarative, HTML-based language that makes building web apps fun
https://markojs.com/
MIT License
13.37k stars 644 forks source link

Internal documentation URLs are broken #1049

Closed ZhangYiJiang closed 6 years ago

ZhangYiJiang commented 6 years ago

Details

The links to framework integration (Express, Koa, etc.) on https://markojs.com/docs/server-side-rendering/ in the section that starts with "ProTip: Marko also provides server-side framework integrations" go to 404 pages (eg. https://markojs.com/docs/express.md, the correct URL is https://markojs.com/docs/express)

Expected Behavior

The links should go to the correct page

Actual Behavior

The links go to 404 pages

Possible Fix

The bug is caused by the .md extension on the links. Removing them will probably fix the issue, but then the links on the source Markdown file viewed on GitHub at https://github.com/marko-js/marko/blob/master/docs/server-side-rendering.md would break.

Ideally the extensions should be stripped when the documentation site is built, or URL rewrite can be done on the server to remove the .md

austinkelleher commented 6 years ago

Thanks for the report and detailed explanation @ZhangYiJiang. We should probably apply a fix somewhere in here: https://github.com/marko-js/markojs-website/blob/master/routes/docs/util/markdown.js#L79

austinkelleher commented 6 years ago

This was actually an issue with the relative URLs in the Markdown files. I've fixed this and published a new version. We still need to publish a new version of the website.