Uh oh!
There was an error while loading. Please reload this page.
Supporting .md extensions in routes - #85
Conversation
Deploying with |
| Latest commit: | 93d6ed8 |
| Status: | ✅ Deploy successful! |
| Preview URL: | https://47ea82bb.topology.pages.dev |
| Branch Preview URL: | https://support-md-urls.topology.pages.dev |
StevenClontz
commented
Nov 25, 2023
Adds support for the following URLs:
Particular use-case: copy-pasting Markdown filepaths from Shortcoming: I'd prefer these all redirect to the canonical URL https://support-md-urls.topology.pages.dev/spaces/S000001 Thoughts @jamesdabbs? |
.md extensions in routes| import type { ParamMatcher } from '@sveltejs/kit' | ||
| export const match: ParamMatcher = param => { | ||
| return /^\w?(\d+)(.md)?$/.test(param) |
There was a problem hiding this comment.
Is there a reason you want to allow things that don't start with an expected letter prefix here?
There was a problem hiding this comment.
Ah, I got it ... because you want spaces/1 to Just Work. I think that's fine in this case, but does complicate the case of spaces/1/properties/1 if you want to rewrite it. In that case, you can't just rewrite the given id string, and instead have to deeply understand the position in the routes.
There was a problem hiding this comment.
I'm okay with requiring prefix; at least, supporting non-prefixed IDs when known in context can come later.
jamesdabbs
commented
Dec 12, 2023
#105 is a PR off of this branch that should handle the redirection (but it does not handle un-prefixed ids, for the reason above). |
StevenClontz
commented
Dec 12, 2023
Closing in lieu of #105 |
No description provided.