diff options
| author | Fuwn <[email protected]> | 2022-04-14 18:29:03 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-04-14 18:29:03 -0700 |
| commit | 97b08663354d5f2c494151bcd97d40475ee8d3b7 (patch) | |
| tree | ec53d4348bbfa03c4faa9e83fcf2378e8947b9a3 /src/modules.rs | |
| parent | feat: route fixing (diff) | |
| download | locus-97b08663354d5f2c494151bcd97d40475ee8d3b7.tar.xz locus-97b08663354d5f2c494151bcd97d40475ee8d3b7.zip | |
feat: sitemap
Diffstat (limited to 'src/modules.rs')
| -rw-r--r-- | src/modules.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/modules.rs b/src/modules.rs index 0067266..8189fb3 100644 --- a/src/modules.rs +++ b/src/modules.rs @@ -25,7 +25,7 @@ use std::{ use rand::seq::SliceRandom; use windmark::Response; -use crate::{success, Main, QUOTES}; +use crate::{success, track_mount, Main, QUOTES}; #[allow(clippy::too_many_lines)] pub fn multi_blog(router: &mut windmark::Router) { @@ -103,7 +103,8 @@ pub fn multi_blog(router: &mut windmark::Router) { let blog_clone = blogs.clone(); - router.mount( + track_mount( + router, "/blog", Box::new(move |context| { success!( @@ -135,7 +136,8 @@ pub fn multi_blog(router: &mut windmark::Router) { let entries_clone = entries.clone(); let fixed_blog_name_clone = fixed_blog_name.clone(); - router.mount( + track_mount( + router, &format!("/blog/{}", fixed_blog_name), Box::new(move |context| { success!( @@ -168,7 +170,8 @@ pub fn multi_blog(router: &mut windmark::Router) { ); for (title, contents) in entries { - router.mount( + track_mount( + router, &format!("/blog/{}/{}", fixed_blog_name, title.to_lowercase()), Box::new(move |context| success!(contents, context)), ); |