diff --git a/Cargo.lock b/Cargo.lock index 8b3be7d..03f4127 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,6 +10,7 @@ dependencies = [ "axum", "tokio", "tower-http", + "tower-livereload", ] [[package]] @@ -655,6 +656,20 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" +[[package]] +name = "tower-livereload" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7df210bd982165dee3c20e31deed79a3585ee6b255c070d9c73ae015cc40d2f3" +dependencies = [ + "bytes", + "http", + "http-body", + "pin-project-lite", + "tokio", + "tower", +] + [[package]] name = "tower-service" version = "0.3.3" diff --git a/Cargo.toml b/Cargo.toml index 1d23c15..80c8556 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,3 +8,4 @@ askama = { version = "0.15.4", features = ["std", "derive"] } axum = "0.8.8" tokio = { version = "1.50.0", features = ["full"] } tower-http = { version = "0.6.8", features = ["fs"] } +tower-livereload = "0.10.3" diff --git a/src/main.rs b/src/main.rs index 782307e..70c9b3c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,8 @@ use agahnim_web_v2::templates::index::home; use axum::{Router, routing::get}; use tower_http::services::ServeDir; +#[cfg(debug_assertions)] +use tower_livereload::LiveReloadLayer; #[tokio::main] async fn main() { @@ -8,6 +10,10 @@ async fn main() { .route("/", get(home)) .nest_service("/static", ServeDir::new("static")); + // We need to include this flag so that the live reload layer isn't included when the server is built + #[cfg(debug_assertions)] + let app = app.layer(LiveReloadLayer::new()); + let listener = tokio::net::TcpListener::bind("0.0.0.0:7122") .await .expect("Failed to bind to port 7122"); diff --git a/static/audio/startup.mp3 b/static/assets/audio/startup.mp3 similarity index 100% rename from static/audio/startup.mp3 rename to static/assets/audio/startup.mp3 diff --git a/static/badges/88x31computer.gif b/static/assets/badges/88x31computer.gif similarity index 100% rename from static/badges/88x31computer.gif rename to static/assets/badges/88x31computer.gif diff --git a/static/badges/cssisawesome.webp b/static/assets/badges/cssisawesome.webp similarity index 100% rename from static/badges/cssisawesome.webp rename to static/assets/badges/cssisawesome.webp diff --git a/static/badges/kirby.gif b/static/assets/badges/kirby.gif similarity index 100% rename from static/badges/kirby.gif rename to static/assets/badges/kirby.gif diff --git a/static/badges/pink.gif b/static/assets/badges/pink.gif similarity index 100% rename from static/badges/pink.gif rename to static/assets/badges/pink.gif diff --git a/static/badges/queer.webp b/static/assets/badges/queer.webp similarity index 100% rename from static/badges/queer.webp rename to static/assets/badges/queer.webp diff --git a/static/badges/skywardsword.webp b/static/assets/badges/skywardsword.webp similarity index 100% rename from static/badges/skywardsword.webp rename to static/assets/badges/skywardsword.webp diff --git a/static/badges/trans.gif b/static/assets/badges/trans.gif similarity index 100% rename from static/badges/trans.gif rename to static/assets/badges/trans.gif diff --git a/static/badges/transrightsnow.webp b/static/assets/badges/transrightsnow.webp similarity index 100% rename from static/badges/transrightsnow.webp rename to static/assets/badges/transrightsnow.webp diff --git a/static/gifs/aboutme.gif b/static/assets/gifs/aboutme.gif similarity index 100% rename from static/gifs/aboutme.gif rename to static/assets/gifs/aboutme.gif diff --git a/static/gifs/abstract.gif b/static/assets/gifs/abstract.gif similarity index 100% rename from static/gifs/abstract.gif rename to static/assets/gifs/abstract.gif diff --git a/static/gifs/areasofinterest.gif b/static/assets/gifs/areasofinterest.gif similarity index 100% rename from static/gifs/areasofinterest.gif rename to static/assets/gifs/areasofinterest.gif diff --git a/static/gifs/decoration1.gif b/static/assets/gifs/decoration1.gif similarity index 100% rename from static/gifs/decoration1.gif rename to static/assets/gifs/decoration1.gif diff --git a/static/gifs/divider2.gif b/static/assets/gifs/divider2.gif similarity index 100% rename from static/gifs/divider2.gif rename to static/assets/gifs/divider2.gif diff --git a/static/gifs/globe.gif b/static/assets/gifs/globe.gif similarity index 100% rename from static/gifs/globe.gif rename to static/assets/gifs/globe.gif diff --git a/static/gifs/literatureabout.gif b/static/assets/gifs/literatureabout.gif similarity index 100% rename from static/gifs/literatureabout.gif rename to static/assets/gifs/literatureabout.gif diff --git a/static/gifs/music.gif b/static/assets/gifs/music.gif similarity index 100% rename from static/gifs/music.gif rename to static/assets/gifs/music.gif diff --git a/static/gifs/musicabout.gif b/static/assets/gifs/musicabout.gif similarity index 100% rename from static/gifs/musicabout.gif rename to static/assets/gifs/musicabout.gif diff --git a/static/gifs/otherabout.gif b/static/assets/gifs/otherabout.gif similarity index 100% rename from static/gifs/otherabout.gif rename to static/assets/gifs/otherabout.gif diff --git a/static/gifs/pcgif.gif b/static/assets/gifs/pcgif.gif similarity index 100% rename from static/gifs/pcgif.gif rename to static/assets/gifs/pcgif.gif diff --git a/static/gifs/projects.gif b/static/assets/gifs/projects.gif similarity index 100% rename from static/gifs/projects.gif rename to static/assets/gifs/projects.gif diff --git a/static/gifs/tekken.gif b/static/assets/gifs/tekken.gif similarity index 100% rename from static/gifs/tekken.gif rename to static/assets/gifs/tekken.gif diff --git a/static/gifs/title.gif b/static/assets/gifs/title.gif similarity index 100% rename from static/gifs/title.gif rename to static/assets/gifs/title.gif diff --git a/static/gifs/updates.gif b/static/assets/gifs/updates.gif similarity index 100% rename from static/gifs/updates.gif rename to static/assets/gifs/updates.gif diff --git a/static/gifs/vgabout.gif b/static/assets/gifs/vgabout.gif similarity index 100% rename from static/gifs/vgabout.gif rename to static/assets/gifs/vgabout.gif diff --git a/static/gifs/wtfis.gif b/static/assets/gifs/wtfis.gif similarity index 100% rename from static/gifs/wtfis.gif rename to static/assets/gifs/wtfis.gif diff --git a/static/icons/github.webp b/static/assets/icons/github.webp similarity index 100% rename from static/icons/github.webp rename to static/assets/icons/github.webp diff --git a/static/icons/insta.webp b/static/assets/icons/insta.webp similarity index 100% rename from static/icons/insta.webp rename to static/assets/icons/insta.webp diff --git a/static/icons/spotify.webp b/static/assets/icons/spotify.webp similarity index 100% rename from static/icons/spotify.webp rename to static/assets/icons/spotify.webp diff --git a/static/images/about.webp b/static/assets/images/about.webp similarity index 100% rename from static/images/about.webp rename to static/assets/images/about.webp diff --git a/static/images/ashen.webp b/static/assets/images/ashen.webp similarity index 100% rename from static/images/ashen.webp rename to static/assets/images/ashen.webp diff --git a/static/images/bibidraw.webp b/static/assets/images/bibidraw.webp similarity index 100% rename from static/images/bibidraw.webp rename to static/assets/images/bibidraw.webp diff --git a/static/images/bibou.webp b/static/assets/images/bibou.webp similarity index 100% rename from static/images/bibou.webp rename to static/assets/images/bibou.webp diff --git a/static/images/bibu2.webp b/static/assets/images/bibu2.webp similarity index 100% rename from static/images/bibu2.webp rename to static/assets/images/bibu2.webp diff --git a/static/images/boubou.webp b/static/assets/images/boubou.webp similarity index 100% rename from static/images/boubou.webp rename to static/assets/images/boubou.webp diff --git a/static/images/boubouille.webp b/static/assets/images/boubouille.webp similarity index 100% rename from static/images/boubouille.webp rename to static/assets/images/boubouille.webp diff --git a/static/images/cornerbl.webp b/static/assets/images/cornerbl.webp similarity index 100% rename from static/images/cornerbl.webp rename to static/assets/images/cornerbl.webp diff --git a/static/images/cornerbr.webp b/static/assets/images/cornerbr.webp similarity index 100% rename from static/images/cornerbr.webp rename to static/assets/images/cornerbr.webp diff --git a/static/images/cornertl.webp b/static/assets/images/cornertl.webp similarity index 100% rename from static/images/cornertl.webp rename to static/assets/images/cornertl.webp diff --git a/static/images/cornertr.webp b/static/assets/images/cornertr.webp similarity index 100% rename from static/images/cornertr.webp rename to static/assets/images/cornertr.webp diff --git a/static/images/dev.webp b/static/assets/images/dev.webp similarity index 100% rename from static/images/dev.webp rename to static/assets/images/dev.webp diff --git a/static/images/leuf.webp b/static/assets/images/leuf.webp similarity index 100% rename from static/images/leuf.webp rename to static/assets/images/leuf.webp diff --git a/static/images/life.webp b/static/assets/images/life.webp similarity index 100% rename from static/images/life.webp rename to static/assets/images/life.webp diff --git a/static/images/music.webp b/static/assets/images/music.webp similarity index 100% rename from static/images/music.webp rename to static/assets/images/music.webp diff --git a/static/images/pfp.webp b/static/assets/images/pfp.webp similarity index 100% rename from static/images/pfp.webp rename to static/assets/images/pfp.webp diff --git a/static/images/rapla.webp b/static/assets/images/rapla.webp similarity index 100% rename from static/images/rapla.webp rename to static/assets/images/rapla.webp diff --git a/static/images/savall.webp b/static/assets/images/savall.webp similarity index 100% rename from static/images/savall.webp rename to static/assets/images/savall.webp diff --git a/static/images/tiledbgpink.webp b/static/assets/images/tiledbgpink.webp similarity index 100% rename from static/images/tiledbgpink.webp rename to static/assets/images/tiledbgpink.webp diff --git a/static/images/welcome.webp b/static/assets/images/welcome.webp similarity index 100% rename from static/images/welcome.webp rename to static/assets/images/welcome.webp diff --git a/static/music/DAWN.mp3 b/static/assets/music/DAWN.mp3 similarity index 100% rename from static/music/DAWN.mp3 rename to static/assets/music/DAWN.mp3 diff --git a/static/music/carcer.mp3 b/static/assets/music/carcer.mp3 similarity index 100% rename from static/music/carcer.mp3 rename to static/assets/music/carcer.mp3 diff --git a/static/music/dark.mp3 b/static/assets/music/dark.mp3 similarity index 100% rename from static/music/dark.mp3 rename to static/assets/music/dark.mp3 diff --git a/static/music/elevator.mp3 b/static/assets/music/elevator.mp3 similarity index 100% rename from static/music/elevator.mp3 rename to static/assets/music/elevator.mp3 diff --git a/static/music/fading.mp3 b/static/assets/music/fading.mp3 similarity index 100% rename from static/music/fading.mp3 rename to static/assets/music/fading.mp3 diff --git a/static/music/farewells.mp3 b/static/assets/music/farewells.mp3 similarity index 100% rename from static/music/farewells.mp3 rename to static/assets/music/farewells.mp3 diff --git a/static/music/hindsight.mp3 b/static/assets/music/hindsight.mp3 similarity index 100% rename from static/music/hindsight.mp3 rename to static/assets/music/hindsight.mp3 diff --git a/static/music/infinity.mp3 b/static/assets/music/infinity.mp3 similarity index 100% rename from static/music/infinity.mp3 rename to static/assets/music/infinity.mp3 diff --git a/static/music/listening.mp3 b/static/assets/music/listening.mp3 similarity index 100% rename from static/music/listening.mp3 rename to static/assets/music/listening.mp3 diff --git a/static/music/machines.mp3 b/static/assets/music/machines.mp3 similarity index 100% rename from static/music/machines.mp3 rename to static/assets/music/machines.mp3 diff --git a/static/music/move_on.mp3 b/static/assets/music/move_on.mp3 similarity index 100% rename from static/music/move_on.mp3 rename to static/assets/music/move_on.mp3 diff --git a/static/music/perfect_light.mp3 b/static/assets/music/perfect_light.mp3 similarity index 100% rename from static/music/perfect_light.mp3 rename to static/assets/music/perfect_light.mp3 diff --git a/static/music/switch.mp3 b/static/assets/music/switch.mp3 similarity index 100% rename from static/music/switch.mp3 rename to static/assets/music/switch.mp3 diff --git a/static/music/times.mp3 b/static/assets/music/times.mp3 similarity index 100% rename from static/music/times.mp3 rename to static/assets/music/times.mp3 diff --git a/static/music/without.mp3 b/static/assets/music/without.mp3 similarity index 100% rename from static/music/without.mp3 rename to static/assets/music/without.mp3 diff --git a/static/videos/about.webm b/static/assets/videos/about.webm similarity index 100% rename from static/videos/about.webm rename to static/assets/videos/about.webm diff --git a/static/videos/dev.webm b/static/assets/videos/dev.webm similarity index 100% rename from static/videos/dev.webm rename to static/assets/videos/dev.webm diff --git a/static/videos/dev2.webm b/static/assets/videos/dev2.webm similarity index 100% rename from static/videos/dev2.webm rename to static/assets/videos/dev2.webm diff --git a/static/videos/landing.webm b/static/assets/videos/landing.webm similarity index 100% rename from static/videos/landing.webm rename to static/assets/videos/landing.webm diff --git a/static/videos/music.webm b/static/assets/videos/music.webm similarity index 100% rename from static/videos/music.webm rename to static/assets/videos/music.webm diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..606ebdf --- /dev/null +++ b/static/style.css @@ -0,0 +1,3 @@ +body { + background-color: crimson; +} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 7d23ac9..6861c1a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -2,7 +2,9 @@ - {% block title %}Mon Site{% endblock %} + + + Agahnim diff --git a/templates/index.html b/templates/index.html index 37b4733..8f61d22 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,6 +1,5 @@ {% extends "base.html" %} -{% block title %}Accueil{% endblock %} {% block content %}

Bonjour