aienos.com
Source of www.aienos.com, served from my own hardware
Brought by drakestapleton
aienos.com / crates / site-builder / src / layouts / base.rs
| 1 | use maud::{html, Markup, DOCTYPE}; |
| 2 | |
| 3 | pub fn render_base_layout(content: Markup) -> Markup { |
| 4 | render_page_layout( |
| 5 | "AienOS | Persistent machine intelligence you own", |
| 6 | "An experimental, open source machine for turning search into verified understanding, running on five real machines. Every claim carries a public receipt.", |
| 7 | "https://www.aienos.com/", |
| 8 | "website", |
| 9 | html! { |
| 10 | // Zero-dependency terminal micro-script |
| 11 | script defer src="/js/terminal.js" {} |
| 12 | script defer src="/js/turing-game.js" {} |
| 13 | }, |
| 14 | content, |
| 15 | ) |
| 16 | } |
| 17 | |
| 18 | /// Parameterized page layout for non-homepage pages (blog, posts). |
| 19 | /// Title, description, and canonical URL are set per page. `extra_head` |
| 20 | /// carries page-specific scripts (e.g. the comments loader on post pages). |
| 21 | /// Social cards, feed links and JSON-LD are added to |
| 22 | /// every written page by `seo::enrich`, so they are not repeated here. |
| 23 | pub fn render_page_layout( |
| 24 | title: &str, |
| 25 | description: &str, |
| 26 | og_url: &str, |
| 27 | og_type: &str, |
| 28 | extra_head: Markup, |
| 29 | content: Markup, |
| 30 | ) -> Markup { |
| 31 | html! { |
| 32 | (DOCTYPE) |
| 33 | html lang="en" { |
| 34 | head { |
| 35 | meta charset="utf-8"; |
| 36 | meta name="viewport" content="width=device-width, initial-scale=1"; |
| 37 | title { (title) } |
| 38 | meta name="description" content=(description); |
| 39 | @if !og_url.is_empty() { link rel="canonical" href=(og_url); } |
| 40 | link rel="icon" type="image/svg+xml" href="/favicon.svg"; |
| 41 | meta property="og:type" content=(og_type); |
| 42 | |
| 43 | // Stylesheet |
| 44 | link rel="stylesheet" href="/assets/style.css"; |
| 45 | // Shared six-section header (also linked by hand-written pages) |
| 46 | link rel="stylesheet" href="/assets/site-nav.css"; |
| 47 | // The Turing look, shared by every page (loaded last) |
| 48 | link rel="stylesheet" href="/assets/turing-look.css"; |
| 49 | // The machines and the speeds (homepage and /machine/) |
| 50 | link rel="stylesheet" href="/assets/machines.css"; |
| 51 | script defer src="/js/turing-look.js" {} |
| 52 | |
| 53 | (extra_head) |
| 54 | } |
| 55 | body { |
| 56 | div id="root" style="min-height: 100vh; display: flex; flex-direction: column;" { |
| 57 | a class="skip-link" href="#main-content" { "Skip to content" } |
| 58 | (crate::components::navbar::render_navbar()) |
| 59 | main id="main-content" style="flex: 1;" { |
| 60 | (content) |
| 61 | } |
| 62 | (crate::components::footer::render_footer()) |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | } |