From 9f7b903901acb0cd6ec9cb2146406a92ebf79cab Mon Sep 17 00:00:00 2001 From: Vika Date: Fri, 7 Oct 2022 19:53:04 +0300 Subject: templates: move static assets to the templates crate It makes more sense to keep CSS near the templates, and the client-side JavaScript code too, since it depends on the DOM structure to work. Additionally, the overhead of `include_dir!()` is almost completely mitigated by the fact that this is a separate crate that isn't recompiled often. The linking stage, however, is still expected to take a little bit long. But I doubt it'd be longer than what it was before, since it's the same exact files that get linked into the app. --- kittybox-rs/templates/Cargo.toml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'kittybox-rs/templates/Cargo.toml') diff --git a/kittybox-rs/templates/Cargo.toml b/kittybox-rs/templates/Cargo.toml index a32a3a2..ffdfc25 100644 --- a/kittybox-rs/templates/Cargo.toml +++ b/kittybox-rs/templates/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "kittybox-templates" +name = "kittybox-frontend-renderer" version = "0.1.0" edition = "2021" @@ -12,10 +12,12 @@ rand = "^0.8.5" version="^0.2.0" [dependencies] -ellipse = "^0.2.0" # Truncate and ellipsize strings in a human-friendly way -http = "^0.2.7" # Hyper's strong HTTP types -markup = "^0.12.0" # HTML templating engine -serde_json = "^1.0.64" # A JSON serialization file format +ellipse = "^0.2.0" +http = "^0.2.7" +markup = "^0.12.0" +serde_json = "^1.0.64" +include_dir = "^0.7.2" +axum = "^0.5.16" [dependencies.chrono] version = "^0.4.19" features = ["serde"] -- cgit 1.4.1