Spaces:
Running
Running
neon_arch
commited on
Commit
·
7206e7d
1
Parent(s):
9a4e450
✨ feat: provide a condition based handling to only import the animation when the config option has a value (#424)
Browse files
src/templates/partials/header.rs
CHANGED
@@ -13,7 +13,7 @@ use maud::{html, Markup, PreEscaped, DOCTYPE};
|
|
13 |
/// # Returns
|
14 |
///
|
15 |
/// It returns the compiled html markup code for the header as a result.
|
16 |
-
pub fn header(colorscheme: &str, theme: &str) -> Markup {
|
17 |
html!(
|
18 |
(DOCTYPE)
|
19 |
html lang="en"
|
@@ -24,6 +24,9 @@ pub fn header(colorscheme: &str, theme: &str) -> Markup {
|
|
24 |
meta name="viewport" content="width=device-width, initial-scale=1";
|
25 |
link href=(format!("static/colorschemes/{colorscheme}.css")) rel="stylesheet" type="text/css";
|
26 |
link href=(format!("static/themes/{theme}.css")) rel="stylesheet" type="text/css";
|
|
|
|
|
|
|
27 |
}
|
28 |
|
29 |
(PreEscaped("<body onload=\"getClientSettings()\">"))
|
|
|
13 |
/// # Returns
|
14 |
///
|
15 |
/// It returns the compiled html markup code for the header as a result.
|
16 |
+
pub fn header(colorscheme: &str, theme: &str, animation: &Option<String>) -> Markup {
|
17 |
html!(
|
18 |
(DOCTYPE)
|
19 |
html lang="en"
|
|
|
24 |
meta name="viewport" content="width=device-width, initial-scale=1";
|
25 |
link href=(format!("static/colorschemes/{colorscheme}.css")) rel="stylesheet" type="text/css";
|
26 |
link href=(format!("static/themes/{theme}.css")) rel="stylesheet" type="text/css";
|
27 |
+
@if animation.is_some() {
|
28 |
+
link href=(format!("static/animations/{}.css", animation.as_ref().unwrap())) rel="stylesheet" type="text/css";
|
29 |
+
}
|
30 |
}
|
31 |
|
32 |
(PreEscaped("<body onload=\"getClientSettings()\">"))
|