add: rewrite root html

This commit is contained in:
trisua 2025-05-31 10:17:49 -04:00
parent 78d0766345
commit 350e47f4b7
7 changed files with 405 additions and 442 deletions

View file

@ -36,7 +36,7 @@ pub const ME_JS: &str = include_str!("./public/js/me.js");
pub const STREAMS_JS: &str = include_str!("./public/js/streams.js");
// html
pub const ROOT: &str = include_str!("./public/html/root.html");
pub const ROOT: &str = include_str!("./public/html/root.lisp");
pub const MACROS: &str = include_str!("./public/html/macros.html");
pub const COMPONENTS: &str = include_str!("./public/html/components.html");
@ -140,7 +140,13 @@ pub(crate) async fn pull_icon(icon: &str, icons_dir: &str) {
}
println!("download icon: {icon}");
let svg = reqwest::get(icon_url).await.unwrap().text().await.unwrap();
let svg = reqwest::get(icon_url)
.await
.unwrap()
.text()
.await
.unwrap()
.replace("\n", "");
write(&file_path, &svg).unwrap();
writer.insert(icon.to_string(), svg);
@ -245,7 +251,7 @@ pub(crate) async fn write_assets(config: &Config) -> PathBufD {
// ...
let html_path = PathBufD::current().join(&config.dirs.templates);
write_template!(html_path->"root.html"(crate::assets::ROOT) --config=config);
write_template!(html_path->"root.html"(crate::assets::ROOT) --config=config --lisp);
write_template!(html_path->"macros.html"(crate::assets::MACROS) --config=config);
write_template!(html_path->"components.html"(crate::assets::COMPONENTS) --config=config);