mirror of
https://github.com/neon-mmd/websurfx.git
synced 2024-11-21 21:48:21 -05:00
✨ feat: provide a condition based handling to only import the animation when the config option has a value (#424)
This commit is contained in:
parent
9a4e450766
commit
7206e7d6a1
@ -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<String>) -> 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("<body onload=\"getClientSettings()\">"))
|
||||
|
Loading…
Reference in New Issue
Block a user