mirror of
https://github.com/Dangoware/confetti-box.git
synced 2025-04-19 15:22:57 -05:00
Improve resource loading on pages
This commit is contained in:
parent
07487415c1
commit
7033220688
2 changed files with 6 additions and 6 deletions
|
@ -25,18 +25,18 @@ use utils::hash_file;
|
|||
use uuid::Uuid;
|
||||
|
||||
/// Stylesheet
|
||||
#[get("/main.css")]
|
||||
#[get("/resources/main.css")]
|
||||
fn stylesheet() -> RawCss<&'static str> {
|
||||
RawCss(include_str!("../web/main.css"))
|
||||
}
|
||||
|
||||
/// Upload handler javascript
|
||||
#[get("/request.js")]
|
||||
#[get("/resources/request.js")]
|
||||
fn form_handler_js() -> RawJavaScript<&'static str> {
|
||||
RawJavaScript(include_str!("../web/request.js"))
|
||||
}
|
||||
|
||||
#[get("/favicon.svg")]
|
||||
#[get("/resources/favicon.svg")]
|
||||
fn favicon() -> (ContentType, &'static str) {
|
||||
(ContentType::SVG, include_str!("../web/favicon.svg"))
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ fn favicon() -> (ContentType, &'static str) {
|
|||
fn home(settings: &State<Settings>) -> Markup {
|
||||
html! {
|
||||
(head("Confetti-Box"))
|
||||
script src="./request.js" { }
|
||||
script src="/resources/request.js" { }
|
||||
|
||||
center {
|
||||
h1 { "Confetti-Box 🎉" }
|
||||
|
|
|
@ -9,8 +9,8 @@ pub fn head(page_title: &str) -> Markup {
|
|||
meta charset="UTF-8";
|
||||
meta name="viewport" content="width=device-width, initial-scale=1";
|
||||
title { (page_title) }
|
||||
link rel="icon" type="image/svg+xml" href="favicon.svg";
|
||||
link rel="stylesheet" href="./main.css";
|
||||
link rel="icon" type="image/svg+xml" href="/resources/favicon.svg";
|
||||
link rel="stylesheet" href="/resources/main.css";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue