Some checks failed
CI/CD Pipeline / Test Suite (push) Has been cancelled
CI/CD Pipeline / Security Audit (push) Has been cancelled
CI/CD Pipeline / Performance Benchmarks (push) Has been cancelled
Rust CI / Security Audit (push) Has been cancelled
Rust CI / Check + Test + Lint (nightly) (push) Has been cancelled
Rust CI / Check + Test + Lint (stable) (push) Has been cancelled
CI/CD Pipeline / Build Docker Image (push) Has been cancelled
CI/CD Pipeline / Deploy to Staging (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Cleanup (push) Has been cancelled
66 lines
1.8 KiB
Rust
66 lines
1.8 KiB
Rust
//! jpl-website Library
|
|
//!
|
|
//! Core application components and functionality.
|
|
|
|
use leptos::*;
|
|
use rustelo_core::prelude::*;
|
|
use rustelo_web::prelude::*;
|
|
|
|
pub mod components;
|
|
pub mod pages;
|
|
|
|
use components::*;
|
|
use pages::*;
|
|
|
|
/// Main application component
|
|
#[component]
|
|
pub fn App() -> impl IntoView {
|
|
// Provide global application state
|
|
provide_meta_context();
|
|
|
|
view! {
|
|
<Html lang="en" />
|
|
<Title text="jpl-website" />
|
|
<Meta name="description" content="{{description}}" />
|
|
<Meta charset="utf-8" />
|
|
<Meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
// Global styles
|
|
<Link rel="stylesheet" href="/styles/unocss.css" />
|
|
<Link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
|
|
|
<Body class="bg-gray-50 text-gray-900" />
|
|
|
|
<Router>
|
|
<Navigation />
|
|
<main class="min-h-screen">
|
|
<Routes>
|
|
<Route path="/" view=Home />
|
|
<Route path="/about" view=About />
|
|
<Route path="/blog" view=BlogList />
|
|
<Route path="/blog/:slug" view=BlogPost />
|
|
<Route path="/*any" view=NotFound />
|
|
</Routes>
|
|
</main>
|
|
<Footer />
|
|
</Router>
|
|
}
|
|
}
|
|
|
|
/// 404 Not Found page
|
|
#[component]
|
|
fn NotFound() -> impl IntoView {
|
|
view! {
|
|
<div class="rustelo-container rustelo-section text-center">
|
|
<h1 class="text-4xl font-bold text-gray-900 mb-4">
|
|
"404 - Page Not Found"
|
|
</h1>
|
|
<p class="text-xl text-gray-600 mb-8">
|
|
"The page you're looking for doesn't exist."
|
|
</p>
|
|
<a href="/" class="btn-primary">
|
|
"Go Home"
|
|
</a>
|
|
</div>
|
|
}
|
|
}
|