How to set up a dynamic route using front matter #29
-
Hello! When adding article files according to docs instructions, the specification generates paths on a directory basis, so I believe some additional modification is necessary to achieve the above, but I would like to set up a dynamic route only for a given folder (see below), while also retaining the directory-based generation logic. Current
After Changed
Any good ideas would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Currently QWER does not support this kind of routing rule. It is trivial to do I think. Just that my code is a bit messy. I will find time to do what you just described if that's the feature you are requesting. |
Beta Was this translation helpful? Give feedback.
-
@kwchang0831 Well, my blog has more than 300 articles in the past, therefore considering future maintainability, I would like to control it with front matter if possible. I'm still trying to figure out if there's an easier way to do this. |
Beta Was this translation helpful? Give feedback.
-
@nemu1113 Your request has been fulfilled as of (63efeeb). The doc is also updated: https://docs-svelte-qwer.vercel.app/config/qwer-config-js#special-routing-rules Migrate your export const UserConfig = {
...
+ RoutingRules: {
+ PostsYearMonthDate: true,
+ },
}; Let me know if there is any issues. Also, I have not yet tested 300+ articles. Hopefully QWER is able to handle that many posts. I suspect the performance of index page will degrade. Just not sure by how much. However, I expect PWA offline feature to make consecutive visits work as a charm without delaying while loading the posts. Hmmm...let's see... (finger crossed). |
Beta Was this translation helpful? Give feedback.
@nemu1113 Your request has been fulfilled as of (63efeeb).
The doc is also updated: https://docs-svelte-qwer.vercel.app/config/qwer-config-js#special-routing-rules
Migrate your
QWER.config.js
.Let me know if there is any issues.
Also, I have not yet tested 300+ articles. Hopefully QWER is able to handle that many posts. I suspect the performance of index page will degrade. Just not sure by how much.
However, I expect PWA offline feature to make consecutive visits work as a charm without delaying while loading the posts. Hmmm...let's see... (finger crossed).