diff options
| author | Fuwn <[email protected]> | 2024-06-16 16:29:02 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-06-16 16:29:02 -0700 |
| commit | b8ad47f69d05356cf8dbb095a14c7cb9ea20c81b (patch) | |
| tree | 1a7188f95eb45bf36f45941ffeb9724400c66975 /src/modules/blog/module.rs | |
| parent | fix(blog): use real title for xml title (diff) | |
| download | locus-b8ad47f69d05356cf8dbb095a14c7cb9ea20c81b.tar.xz locus-b8ad47f69d05356cf8dbb095a14c7cb9ea20c81b.zip | |
refactor: constants for root urls
Diffstat (limited to 'src/modules/blog/module.rs')
| -rw-r--r-- | src/modules/blog/module.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/modules/blog/module.rs b/src/modules/blog/module.rs index 7c10b21..2336fb4 100644 --- a/src/modules/blog/module.rs +++ b/src/modules/blog/module.rs @@ -21,6 +21,7 @@ use { modules::blog::config::Blog, response::success, route::track_mount, + url::ROOT_GEMINI_URL, xml::{Item as XmlItem, Writer as XmlWriter}, }, std::{ @@ -163,11 +164,11 @@ pub fn module(router: &mut windmark::router::Router) { let mut xml = XmlWriter::builder(); xml.add_field("title", &name); - xml.add_field("link", &format!("gemini://fuwn.me/blog/{fixed_blog_name}")); + xml.add_field("link", &format!("{ROOT_GEMINI_URL}/blog/{fixed_blog_name}")); xml.add_field("description", &description); xml.add_field("generator", "locus"); xml.add_field("lastBuildDate", &chrono::Local::now().to_rfc2822()); - xml.add_link(&format!("gemini://fuwn.me/blog/{fixed_blog_name}.xml")); + xml.add_link(&format!("{ROOT_GEMINI_URL}/blog/{fixed_blog_name}.xml")); track_mount( router, @@ -238,7 +239,7 @@ pub fn module(router: &mut windmark::router::Router) { builder.add_field( "link", &format!( - "gemini://fuwn.me/blog/{}/{}", + "{ROOT_GEMINI_URL}/blog/{}/{}", fixed_blog_name, title.to_lowercase() ), @@ -247,7 +248,7 @@ pub fn module(router: &mut windmark::router::Router) { builder.add_field( "guid", &format!( - "gemini://fuwn.me/blog/{}/{}", + "{ROOT_GEMINI_URL}/blog/{}/{}", fixed_blog_name, title.to_lowercase() ), |