This commit is contained in:
33
src/main.rs
Normal file
33
src/main.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
mod components;
|
||||
mod templates;
|
||||
mod error_views;
|
||||
|
||||
use perseus::prelude::*;
|
||||
use sycamore::prelude::view;
|
||||
|
||||
#[perseus::main(perseus_axum::dflt_server)]
|
||||
pub fn main<G: Html>() -> PerseusApp<G> {
|
||||
use log::{info, warn};
|
||||
env_logger::init();
|
||||
|
||||
PerseusApp::new()
|
||||
.template(crate::templates::index::get_template())
|
||||
.template(crate::templates::long::get_template())
|
||||
.error_views(crate::error_views::get_error_views())
|
||||
.index_view(|cx| {
|
||||
view! { cx,
|
||||
html {
|
||||
head {
|
||||
meta(charset = "UTF-8")
|
||||
meta(name = "viewport", content = "width=device-width, initial-scale=1.0")
|
||||
// Perseus automatically resolves `/.perseus/static/` URLs to the contents of the `static/` directory at the project root
|
||||
link(rel = "stylesheet", href = ".perseus/static/style.css")
|
||||
}
|
||||
body {
|
||||
// Quirk: this creates a wrapper `<div>` around the root `<div>` by necessity
|
||||
PerseusRoot()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user