finish router refrence
This commit is contained in:
1 parent
07446386e6
commit
b5a2f0d6cb
61 files changed
+676
-1908
No files matched your search
@@ -0,0 +1,15 @@
|
||||
# Static Generation
|
||||
|
||||
## Getting the Sitemap
|
||||
|
||||
The [`Routable`] trait includes an associated [`SITE_MAP`] constant that contains the map of all of the routes in the enum.
|
||||
|
||||
By default, the sitemap is a tree of (static or dynamic) RouteTypes, but it can be flattened into a list of individual routes with the `.flatten()` method.
|
||||
|
||||
## Generating a Sitemap
|
||||
|
||||
To statically render pages, we need to flatten the route tree and generate a file for each route that contains only static segments:
|
||||
|
||||
```rust, no_run
|
||||
{{#include ../../../../packages/router/examples/static_generation.rs}}
|
||||
```
|
||||
Reference in new issue
Block a user