Files
elo/src/main.rs
Matthew Kaminski 90c1f58607
Some checks failed
Build Crate / build (push) Failing after 7m23s
Add initial website
2023-09-17 23:25:46 -04:00

34 lines
1.1 KiB
Rust

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()
}
}
}
})
}