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

29
src/templates/index.rs Normal file
View File

@@ -0,0 +1,29 @@
use crate::components::layout::Layout;
use perseus::prelude::*;
use sycamore::prelude::*;
use crate::templates::get_path;
fn index_page<G: Html>(cx: Scope) -> View<G> {
view! { cx,
Layout(title = "Index") {
// Anything we put in here will be rendered inside the `<main>` block of the layout
p { "Hello World!" }
br {}
a(href = "long") { "Long page" }
}
}
}
#[engine_only_fn]
fn head(cx: Scope) -> View<SsrNode> {
view! { cx,
title { "Index Page" }
}
}
pub fn get_template<G: Html>() -> Template<G> {
Template::build(get_path("").as_str())
.view(index_page)
.head(head)
.build()
}