From 7206e7d6a1383dbb9e27b2fc2f271818d11f5512 Mon Sep 17 00:00:00 2001 From: neon_arch Date: Mon, 11 Dec 2023 21:17:23 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20provide=20a=20condition=20b?= =?UTF-8?q?ased=20handling=20to=20only=20import=20the=20animation=20when?= =?UTF-8?q?=20the=20config=20option=20has=20a=20value=20(#424)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/templates/partials/header.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/templates/partials/header.rs b/src/templates/partials/header.rs index c477aec..e248248 100644 --- a/src/templates/partials/header.rs +++ b/src/templates/partials/header.rs @@ -13,7 +13,7 @@ use maud::{html, Markup, PreEscaped, DOCTYPE}; /// # Returns /// /// It returns the compiled html markup code for the header as a result. -pub fn header(colorscheme: &str, theme: &str) -> Markup { +pub fn header(colorscheme: &str, theme: &str, animation: &Option) -> Markup { html!( (DOCTYPE) html lang="en" @@ -24,6 +24,9 @@ pub fn header(colorscheme: &str, theme: &str) -> Markup { meta name="viewport" content="width=device-width, initial-scale=1"; link href=(format!("static/colorschemes/{colorscheme}.css")) rel="stylesheet" type="text/css"; link href=(format!("static/themes/{theme}.css")) rel="stylesheet" type="text/css"; + @if animation.is_some() { + link href=(format!("static/animations/{}.css", animation.as_ref().unwrap())) rel="stylesheet" type="text/css"; + } } (PreEscaped(""))