How to dynamically load and generate pages? #1112
-
We have a database that people can browse using our api.pulsar-edit.dev/ and other common paths we want to be able to have users explore in a sane way:
We've tossed around using axio or superagent as a way to import it, but not sure how to provide dynamic routing for what it returns. Not only that, but we figured we could use a few things out of config, client config, and the node API but couldn't find the parts about the routing information to provide for that part to generate a page from that. Especially when it returns specific errors like 404, or any others. I know I would have to generate layouts for that, and that's easy enough. It's just figuring out the routing part from the data we get(in json). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Any ideas on this? I found something through various pages, but none of it seemed to be what the person who is in charge of our API was looking for or seemed to explain it very well. We just need a way to dynamically generate and load pages from our api, so we can have people search for our various packages and themes for the editor. |
Beta Was this translation helpful? Give feedback.
-
If you want to render page "Pure dymanicly"
That means you are dropping vuepress SSG support. Any static HTML content will no longer be generated. This means you have to deal 2 situation:
The problem is when you are acutally using Vue, you are using a SPA, and all resources should be redirected to an exisiting file. While vuepress do SSR at build time and provide SSG contents, so when you visit a package, you are loading that resources static content then do a client Hydration. So you no longer need redirects. Also, vuepress doesnot provide any rumtime markdown parsers, you are expected to render a Vue Component and do all the stuff yourself. |
Beta Was this translation helpful? Give feedback.
If you want to render page "Pure dymanicly"
That means you are dropping vuepress SSG support. Any static HTML content will no longer be generated.
This means you have to deal 2 situation:
/404.html
or/index.htm