Add initial website
Some checks failed
Build Crate / build (push) Failing after 7m23s

This commit is contained in:
2023-09-17 23:25:46 -04:00
parent d640899c80
commit 90c1f58607
16 changed files with 492 additions and 2 deletions

33
src/main.rs Normal file
View 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()
}
}
}
})
}