2024-04-29 22:48:53 +02:00
|
|
|
#![allow(non_snake_case)]
|
|
|
|
|
2024-05-14 11:33:25 +02:00
|
|
|
use dioxus::fullstack::Config;
|
2024-04-29 22:48:53 +02:00
|
|
|
use dioxus::prelude::*;
|
2024-05-14 11:33:25 +02:00
|
|
|
|
2024-04-29 22:48:53 +02:00
|
|
|
use tracing::Level;
|
|
|
|
|
|
|
|
pub mod components;
|
|
|
|
mod cv;
|
|
|
|
mod home;
|
|
|
|
mod impressum;
|
|
|
|
mod layout;
|
|
|
|
mod publications;
|
|
|
|
|
|
|
|
use crate::cv::CV;
|
|
|
|
use crate::home::Home;
|
|
|
|
use crate::impressum::Impressum;
|
|
|
|
use crate::layout::Layout;
|
2024-04-30 10:15:56 +02:00
|
|
|
use crate::publications::ProjectsPublications;
|
2024-04-29 22:48:53 +02:00
|
|
|
|
|
|
|
#[derive(Clone, Routable, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
|
|
|
|
pub enum Route {
|
|
|
|
#[layout(Layout)]
|
|
|
|
#[route("/")]
|
|
|
|
Home {},
|
|
|
|
#[route("/impressum")]
|
|
|
|
Impressum {},
|
|
|
|
#[route("/publications")]
|
2024-04-30 10:15:56 +02:00
|
|
|
ProjectsPublications {},
|
2024-04-29 22:48:53 +02:00
|
|
|
#[route("/resume")]
|
|
|
|
CV {},
|
|
|
|
#[end_layout]
|
|
|
|
#[route("/:..route")]
|
|
|
|
PageNotFound { route: Vec<String> },
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2024-05-02 11:04:23 +02:00
|
|
|
dioxus_logger::init(Level::DEBUG).expect("failed to init logger");
|
2024-05-14 11:33:25 +02:00
|
|
|
let config = server_only!(
|
|
|
|
dioxus::fullstack::Config::new().addr(std::net::SocketAddrV4::new(
|
|
|
|
std::net::Ipv4Addr::new(0, 0, 0, 0),
|
|
|
|
8080,
|
|
|
|
))
|
|
|
|
);
|
|
|
|
LaunchBuilder::fullstack().with_cfg(config).launch(App)
|
2024-04-29 22:48:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
fn App() -> Element {
|
|
|
|
rsx! {
|
|
|
|
meta {
|
|
|
|
name: "robots",
|
|
|
|
content: "noindex",
|
|
|
|
},
|
|
|
|
div {
|
|
|
|
class: "bg-white dark:bg-gray-900 min-h-screen",
|
|
|
|
Router::<Route> {},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[component]
|
|
|
|
fn PageNotFound(route: Vec<String>) -> Element {
|
|
|
|
rsx! {
|
|
|
|
div {
|
|
|
|
class: "h-screen flex items-center justify-center",
|
|
|
|
img {
|
|
|
|
class: "size-auto",
|
|
|
|
src: "https://raw.githubusercontent.com/SAWARATSUKI/ServiceLogos/main/404Notfound/NotFound.png"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Props, Clone)]
|
|
|
|
pub struct BodyProp {
|
|
|
|
children: Element,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn Body(prop: BodyProp) -> Element {
|
|
|
|
rsx! {
|
|
|
|
div {
|
|
|
|
class: "flex justify-center my-4",
|
|
|
|
div {
|
2024-05-14 11:33:25 +02:00
|
|
|
class: "max-w-screen-xl min-w-full",
|
2024-04-29 22:48:53 +02:00
|
|
|
{prop.children}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|