From b1b6887a26866037873e0e0de6e94cd357734c90 Mon Sep 17 00:00:00 2001 From: dev Date: Fri, 16 Oct 2026 00:53:46 +0530 Subject: [PATCH] Add whale logo, favicon, apple-touch-icon, and social embeds Logo: hand-crafted SVG whale silhouette in blue gradient (#3b82f6 to #1d4ed8), DeepSeek-inspired minimalist style with water spout, eye, and wave arc. Renders at 28px in the nav header. Embeds: Open Graph and Twitter Card meta tags on every page. og:image is a 1200x630 embed card with the whale logo, WhalePrep title, tagline, and stats. Favicon.png (32x32) and apple-touch-icon.png (180x180) generated from the same SVG. theme-color #0a0f1c for mobile browsers. --- src/views.rs | 33 ++++++++++++++--- static/apple-touch-icon.png | Bin 0 -> 6377 bytes static/embed.png | Bin 0 -> 49443 bytes static/embed.svg | 70 ++++++++++++++++++++++++++++++++++++ static/favicon.png | Bin 0 -> 1005 bytes static/logo.svg | 51 ++++++++++++++++++++++++++ static/style.css | 7 ++++ 7 files changed, 156 insertions(+), 5 deletions(-) create mode 100644 static/apple-touch-icon.png create mode 100644 static/embed.png create mode 100644 static/embed.svg create mode 100644 static/favicon.png create mode 100644 static/logo.svg diff --git a/src/views.rs b/src/views.rs index 63f3270..aba23ad 100644 --- a/src/views.rs +++ b/src/views.rs @@ -88,12 +88,27 @@ pub struct SubjectBlock { fn head(ctx: &Ctx, title: &str) -> String { format!( - r#" + r##" -{t} · WhalePrep +{t} · WhalePrep + + + + + + + + + + + + + + + -"#, +"##, t = esc(title), - b = ctx.base + b = ctx.base, + origin = public_origin() ) } +/// The absolute origin for og:image URLs — meta tags need a full URL, not a +/// relative path. Derived from the request when behind the tunnel; falls +/// back to the production domain. +fn public_origin() -> String { + std::env::var("PUBLIC_ORIGIN").unwrap_or_else(|_| "https://whaleprep.oiupoyt.space".into()) +} + fn nav(ctx: &Ctx, user: Option<&str>) -> String { let brand = format!( - r##"