From b8ad47f69d05356cf8dbb095a14c7cb9ea20c81b Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 16 Jun 2024 16:29:02 -0700 Subject: refactor: constants for root urls --- src/modules/web.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/modules/web.rs') 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, , you would visit . +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, ) }); -- cgit v1.2.3