-
Notifications
You must be signed in to change notification settings - Fork 38
Generate static routes #34
Comments
so we need check route info and generate the file ? |
but the router is manage with |
I actually really like this concept - we could allow a hardcoded list or just look around for the Router component and parse out the contents. |
but how can we generate the |
A "dumb" way would be to spin up a local dev server and scrape it once the page loaded. A more sophisticated way would be to have an "SSR" entry point in your code (alongside other potential entrypoints) that gets called with some environment-driven context. fn main_web() {
dioxus::web::launch(app);
}
fn main_ssr() {
dioxus::ssr::static_gen(app) // prints to stdout
} |
use |
We don't have a static_gen function yet but I could imagine it would pull from environment variables or stdin or IPC and be commanded by the CLI to generate each page. |
We need to allow the CLI to interact with the program. |
Reading routes from dioxus'
Router
would be nice. These routes should then be generated as static html files when executingdioxus build
for a web app.So a
would generate
dist/foo/bar/index.html
.This is what
nuxt generate
does for example.Additionally (or maybe as an easier first step) there should be an option in Dioxus.toml what routes are generated.
The text was updated successfully, but these errors were encountered: