aboutsummaryrefslogtreecommitdiff
path: root/src/modules/web.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-06-16 16:29:02 -0700
committerFuwn <[email protected]>2024-06-16 16:29:02 -0700
commitb8ad47f69d05356cf8dbb095a14c7cb9ea20c81b (patch)
tree1a7188f95eb45bf36f45941ffeb9724400c66975 /src/modules/web.rs
parentfix(blog): use real title for xml title (diff)
downloadlocus-b8ad47f69d05356cf8dbb095a14c7cb9ea20c81b.tar.xz
locus-b8ad47f69d05356cf8dbb095a14c7cb9ea20c81b.zip
refactor: constants for root urls
Diffstat (limited to 'src/modules/web.rs')
-rw-r--r--src/modules/web.rs14
1 files changed, 10 insertions, 4 deletions
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,
)
});