From ba4d782687b5eb8d91fd881a7cb9d0adce7dd9f0 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 13 Feb 2023 18:00:27 +0100 Subject: licences are boring, lets show the source code instead. --- src/layout.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/layout.rs') diff --git a/src/layout.rs b/src/layout.rs index b5ad682..c553990 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -4,8 +4,8 @@ Copyright (C) 2023 metamuffin */ use crate::pages::*; +use crate::source::*; use crate::uri; -use crate::animation::*; use markup::Render; use rocket::{ http::ContentType, @@ -15,14 +15,14 @@ use rocket::{ use std::io::Cursor; markup::define! { - Layout(title: String, main: Main) { + Layout(title: String, main: Main, noimg: bool) { @markup::doctype() html { head { title { @title " - " "metamuffin's website" } } body { - img[src="https://s.metamuffin.org/avatar/default-512.webp", align="left", height=80, hspace=10]; + @if !noimg { img[src="https://s.metamuffin.org/avatar/default-512.webp", align="left", height=80, hspace=10]; } h1 { "metamuffin's personal website" } nav { a[href=uri!(r_about())] { "About" } " " @@ -30,7 +30,7 @@ markup::define! { a[href=uri!(r_contact())] { "Contact" } " " a[href="https://codeberg.org/metamuffin"] { "Codeberg" } " " a[href=uri!(r_pgp_key())] { "PGP-Key" } " " - a[href=uri!(r_wubbel())] { i {"wubbel"} } " " + a[href=uri!(r_source())] { "Sources" } " " } hr; section { @main } @@ -58,6 +58,7 @@ impl<'r, Main: Render> Responder<'r, 'static> for LayoutPage
{ let mut out = String::new(); Layout { main: self.content, + noimg: self.title == "Source", title: self.title, } .render(&mut out) -- cgit v1.2.3-70-g09d2