|
@@ -9,24 +9,10 @@ use dioxus_ssr::incremental::{DefaultRenderer, IncrementalRendererConfig};
|
|
|
|
|
|
#[tokio::main]
|
|
#[tokio::main]
|
|
async fn main() {
|
|
async fn main() {
|
|
- let mut renderer = IncrementalRendererConfig::new(DefaultRenderer {
|
|
|
|
- before_body: r#"<!DOCTYPE html>
|
|
|
|
- <html lang="en">
|
|
|
|
- <head>
|
|
|
|
- <meta charset="UTF-8">
|
|
|
|
- <meta name="viewport" content="width=device-width,
|
|
|
|
- initial-scale=1.0">
|
|
|
|
- <title>Dioxus Application</title>
|
|
|
|
- </head>
|
|
|
|
- <body>"#
|
|
|
|
- .to_string(),
|
|
|
|
- after_body: r#"</body>
|
|
|
|
- </html>"#
|
|
|
|
- .to_string(),
|
|
|
|
- })
|
|
|
|
- .static_dir("./static")
|
|
|
|
- .invalidate_after(Duration::from_secs(10))
|
|
|
|
- .build();
|
|
|
|
|
|
+ let mut renderer = IncrementalRendererConfig::new()
|
|
|
|
+ .static_dir("./static")
|
|
|
|
+ .invalidate_after(Duration::from_secs(10))
|
|
|
|
+ .build();
|
|
|
|
|
|
println!(
|
|
println!(
|
|
"SITE MAP:\n{}",
|
|
"SITE MAP:\n{}",
|
|
@@ -44,9 +30,26 @@ async fn main() {
|
|
.join("\n")
|
|
.join("\n")
|
|
);
|
|
);
|
|
|
|
|
|
- pre_cache_static_routes::<Route, _>(&mut renderer)
|
|
|
|
- .await
|
|
|
|
- .unwrap();
|
|
|
|
|
|
+ pre_cache_static_routes::<Route, _>(
|
|
|
|
+ &mut renderer,
|
|
|
|
+ &DefaultRenderer {
|
|
|
|
+ before_body: r#"<!DOCTYPE html>
|
|
|
|
+ <html lang="en">
|
|
|
|
+ <head>
|
|
|
|
+ <meta charset="UTF-8">
|
|
|
|
+ <meta name="viewport" content="width=device-width,
|
|
|
|
+ initial-scale=1.0">
|
|
|
|
+ <title>Dioxus Application</title>
|
|
|
|
+ </head>
|
|
|
|
+ <body>"#
|
|
|
|
+ .to_string(),
|
|
|
|
+ after_body: r#"</body>
|
|
|
|
+ </html>"#
|
|
|
|
+ .to_string(),
|
|
|
|
+ },
|
|
|
|
+ )
|
|
|
|
+ .await
|
|
|
|
+ .unwrap();
|
|
}
|
|
}
|
|
|
|
|
|
#[inline_props]
|
|
#[inline_props]
|