diff options
author | Vika <vika@fireburn.ru> | 2022-09-19 17:31:57 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2022-09-19 17:31:57 +0300 |
commit | fe116a8117bf398a83bb25efbd5c866fc33c3d4f (patch) | |
tree | 3df00dd52d599c6e887d401298017a5cd061673e /kittybox-rs/src/frontend | |
parent | 66049566ae865e1a4bd049257d6afc0abded16e9 (diff) | |
download | kittybox-fe116a8117bf398a83bb25efbd5c866fc33c3d4f.tar.zst |
Small optimizations to frontend code
There is a possibility of refactoring some of the companion code to act as a generic embedded asset framework and put it in the `util` crate.
Diffstat (limited to 'kittybox-rs/src/frontend')
-rw-r--r-- | kittybox-rs/src/frontend/mod.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/kittybox-rs/src/frontend/mod.rs b/kittybox-rs/src/frontend/mod.rs index 0797ba6..e2187c9 100644 --- a/kittybox-rs/src/frontend/mod.rs +++ b/kittybox-rs/src/frontend/mod.rs @@ -267,13 +267,14 @@ pub async fn catchall<D: Storage>( } } -static STYLE_CSS: &[u8] = include_bytes!("./style.css"); -static ONBOARDING_JS: &[u8] = include_bytes!("./onboarding.js"); -static ONBOARDING_CSS: &[u8] = include_bytes!("./onboarding.css"); +const STYLE_CSS: &[u8] = include_bytes!("./style.css"); +const ONBOARDING_JS: &[u8] = include_bytes!("./onboarding.js"); +const ONBOARDING_CSS: &[u8] = include_bytes!("./onboarding.css"); +const INDIEAUTH_JS: &[u8] = include_bytes!("./indieauth.js"); -static MIME_JS: &str = "application/javascript"; -static MIME_CSS: &str = "text/css"; -static MIME_PLAIN: &str = "text/plain"; +const MIME_JS: &str = "application/javascript"; +const MIME_CSS: &str = "text/css"; +const MIME_PLAIN: &str = "text/plain"; pub async fn statics(Path(name): Path<String>) -> impl IntoResponse { use axum::http::header::CONTENT_TYPE; |