Closed bitspittle closed 2 years ago
Support ways so that if the user visits a URL link like this on the site:
mystie.com/blog/12/comments/5943
and they register the URL with Kobweb like:
/blog/{blogId}/comments/{commentId}
then what happens is we can the function referenced to it like so:
@Page fun CommentPage() { val ctx = rememberPageContext() // ctx.query["blogId"] == 12 && ctx.query["commentId"] = 5943 }
There are two potential ways I can see to make this registration (and perhaps we should support both!)
1) Allow the user to actually rename the file and directories to use curly braces:
file: myapp/pages/blog/{blogId}/comments/{CommentId}.kt
myapp/pages/blog/{blogId}/comments/{CommentId}.kt
2) Allow the user to specify an override on the @Page annotation:
@Page
file: myapp/pages/blog/blogId/comments/CommentId.kt
myapp/pages/blog/blogId/comments/CommentId.kt
@Page("/blog/{blogId}/comments/{commentId}" fun CommentPage() { ... }
Support ways so that if the user visits a URL link like this on the site:
mystie.com/blog/12/comments/5943
and they register the URL with Kobweb like:
/blog/{blogId}/comments/{commentId}
then what happens is we can the function referenced to it like so:
There are two potential ways I can see to make this registration (and perhaps we should support both!)
1) Allow the user to actually rename the file and directories to use curly braces:
file:
myapp/pages/blog/{blogId}/comments/{CommentId}.kt
2) Allow the user to specify an override on the
@Page
annotation:file:
myapp/pages/blog/blogId/comments/CommentId.kt