diff options
author | metamuffin <metamuffin@disroot.org> | 2023-01-20 20:33:44 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-01-20 20:33:44 +0100 |
commit | bf578cf3b131bc430152f952a37a99d449df8d83 (patch) | |
tree | 9f3256a1a65b33578c9cbb47dfd1861ff9f73650 /server/src/routes/ui/style/mod.rs | |
parent | fec515810c931d62194a3db876491fdf7d4cc64f (diff) | |
download | jellything-bf578cf3b131bc430152f952a37a99d449df8d83.tar jellything-bf578cf3b131bc430152f952a37a99d449df8d83.tar.bz2 jellything-bf578cf3b131bc430152f952a37a99d449df8d83.tar.zst |
split css
Diffstat (limited to 'server/src/routes/ui/style/mod.rs')
-rw-r--r-- | server/src/routes/ui/style/mod.rs | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/server/src/routes/ui/style/mod.rs b/server/src/routes/ui/style/mod.rs index ad9c5e5..39e11af 100644 --- a/server/src/routes/ui/style/mod.rs +++ b/server/src/routes/ui/style/mod.rs @@ -8,22 +8,33 @@ use std::{ fn css_bundle() -> String { if cfg!(debug_assertions) { - ["layout.css", "player.css"] - .into_iter() - .map(|n| { - read_to_string( - PathBuf::from_str(file!()) - .unwrap() - .parent() - .unwrap() - .join(n), - ) - .unwrap() - }) - .collect::<Vec<_>>() - .join("\n") + [ + "layout.css", + "player.css", + "itempage.css", + "directorypage.css", + ] + .into_iter() + .map(|n| { + read_to_string( + PathBuf::from_str(file!()) + .unwrap() + .parent() + .unwrap() + .join(n), + ) + .unwrap() + }) + .collect::<Vec<_>>() + .join("\n") } else { - concat!(include_str!("layout.css"), include_str!("player.css")).to_string() + concat!( + include_str!("layout.css"), + include_str!("player.css"), + include_str!("itempage.css"), + include_str!("directorypage.css") + ) + .to_string() } } @@ -68,7 +79,6 @@ fn js_bundle() -> String { } } - #[get("/assets/style.css")] pub fn r_assets_style() -> (ContentType, String) { (ContentType::CSS, css_bundle()) |