diff options
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/blog/module.rs | 9 | ||||
| -rw-r--r-- | src/modules/web.rs | 14 |
2 files changed, 15 insertions, 8 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() ), diff --git a/src/modules/web.rs b/src/modules/web.rs index ccbf4fd..96cd93e 100644 --- a/src/modules/web.rs +++ b/src/modules/web.rs @@ -16,7 +16,11 @@ // SPDX-License-Identifier: GPL-3.0-only use { - crate::{response::success, route::track_mount}, + crate::{ + response::success, + route::track_mount, + url::{ROOT_GEMINI_URL, ROOT_HTTPS_URL}, + }, windmark::response::Response, }; @@ -32,13 +36,15 @@ fn error(message: &str, context: &windmark::context::RouteContext) -> Response { pub fn module(router: &mut windmark::router::Router) { track_mount(router, "/web", "World Wide Web to Gemini Gateway", |context| { success( - &r"# World Wide Web to Gemini Gateway + &format!( + r"# World Wide Web to Gemini Gateway To use this gateway, simply append the address of your target resource to the end of the current route, minus the protocol. -To visit the web version of this exact page, <https://fuwn.me/web>, you would visit <gemini://fuwn.me/web/fuwn.me/web>. +To visit the web version of this exact page, <{ROOT_HTTPS_URL}/web>, you would visit <{ROOT_GEMINI_URL}/web/fuwn.me/web>. -=> /web/fuwn.me/web Try it!", +=> /web/fuwn.me/web Try it!" + ), &context, ) }); |