If the slug provided has an extension try to fetch that resource from Github and render it. If there is no extension add a .md and try to fetch that.
When all else fails render a 404.
This lets us link to files the same way in the app as on github.
/ios would pull up the file from docs/ios.md
But that wouldn't work when linking between markdown files, since the first url would be a 404 when browsing the repo. So to fix that, allow linking to files ending in .md:
If the slug provided has an extension try to fetch that resource from Github and render it. If there is no extension add a
.md
and try to fetch that.When all else fails render a 404.
This lets us link to files the same way in the app as on github.
/ios
would pull up the file fromdocs/ios.md
But that wouldn't work when linking between markdown files, since the first url would be a 404 when browsing the repo. So to fix that, allow linking to files ending in
.md
:/ios.md
would pull up the file fromdocs/ios.md