pub mod components;

pub mod models;

mod pages;

mod utils;

use leptos::*;
use leptos_meta::*;
use leptos_router::*;

#[component]
pub fn App() -> impl IntoView {
    provide_meta_context();

    // https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/

    view! {
        <Stylesheet id="leptos" href="/pkg/portfolio.css"/>
        <Link rel="shortcut icon" type_="image/ico" href="/favicon.ico"/>
        <Link media="(prefers-color-scheme: dark)" rel="stylesheet" href="/css/github-dark-dimmed.min.css"/>
        <Link media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" rel="stylesheet" href="/css/github.min.css"/>
        <script src="/js/highlight.min.js"></script>
        <script src="/js/mermaid.min.js"></script>
        <script src="/js/autoload.js"/>
        <Router>
            <Routes>
                <Route path="" view=pages::Home/>
                <Route path="experience" view=pages::Experience/>
                <Route path="posts" view=pages::PostList/>
                <Route path="posts/:slug" view=pages::PostElement/>
            </Routes>
        </Router>
    }
}
