aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/ui/style/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/routes/ui/style/mod.rs')
-rw-r--r--server/src/routes/ui/style/mod.rs66
1 files changed, 0 insertions, 66 deletions
diff --git a/server/src/routes/ui/style/mod.rs b/server/src/routes/ui/style/mod.rs
deleted file mode 100644
index 4a6830f..0000000
--- a/server/src/routes/ui/style/mod.rs
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- This file is part of jellything (https://codeberg.org/metamuffin/jellything)
- which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
- Copyright (C) 2023 metamuffin <metamuffin.org>
- Copyright (C) 2023 tpart
-*/
-use rocket::{get, http::ContentType};
-
-macro_rules! concat_files {
- ($($files:literal),*) => {{
- #[cfg(debug_assertions)]
- {
- use std::{fs::read_to_string, path::PathBuf, str::FromStr};
- [ $($files),* ]
- .into_iter()
- .map(|n| {
- read_to_string(
- PathBuf::from_str(file!())
- .unwrap()
- .parent()
- .unwrap()
- .join(n),
- )
- .unwrap()
- })
- .collect::<Vec<_>>()
- .join("\n")
- }
- #[cfg(not(debug_assertions))]
- concat!($(include_str!($files)),*).to_string()
- }};
-}
-
-fn css_bundle() -> String {
- concat_files!(
- "layout.css",
- "player.css",
- "nodepage.css",
- "nodecard.css",
- "js-player.css",
- "forms.css"
- )
-}
-
-fn js_bundle() -> String {
- concat_files!(
- // "transition.js",
- "playerconf-copy-url.js",
- "js-player.js"
- )
-}
-
-#[get("/assets/style.css")]
-pub fn r_assets_style() -> (ContentType, String) {
- (ContentType::CSS, css_bundle())
-}
-
-#[get("/assets/cantarell.woff2")]
-pub fn r_assets_font() -> (ContentType, &'static [u8]) {
- (ContentType::WOFF2, include_bytes!("cantarell.woff2"))
-}
-
-#[get("/assets/bundle.js")]
-pub fn r_assets_js() -> (ContentType, String) {
- (ContentType::JavaScript, js_bundle())
-}