1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! Root layout — `RootLayout` component.
//!
//! Equivalent to Next.js's `app/layout.tsx`. This wraps every route in the
//! app: holds document-wide elements (stylesheets, favicon, title) plus
//! `Outlet::<Route> {}`, which is where the matched page renders — same
//! role as `{children}` in a Next.js layout.
//!
//! Wired up via `#[layout(RootLayout)]` in `src/routes.rs`. Persistent
//! across navigation — only the `Outlet` content swaps when you change
//! routes.
//!
//! ## Adding a sub-layout
//!
//! For a layout that wraps a SUBSET of routes (e.g., a sidebar around the
//! dashboard but not the marketing pages — like Next's
//! `app/dashboard/layout.tsx`):
//!
//! 1. Create `src/app/<path>/layout.rs` with another component that has
//! `Outlet::<Route> {}` inside.
//! 2. Add `#[layout(YourSubLayout)]` to the appropriate group in
//! `src/routes.rs` — the inner layout wraps the routes nested under it.
use *;
use crateRoute;
// `asset!()` gives a content-hashed URL — defeats Chrome's aggressive favicon
// cache, which otherwise serves a stale (or missing) icon for the lifetime of
// the tab. Direct `/favicon.png` works too but loses cache-busting.
const FAVICON: Asset = asset!;
const TAILWIND: Asset = asset!;
const MAIN_CSS: Asset = asset!;