From e02923bfe473b474a0b8ea96509a0cbda501e0dc Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 13 Jun 2024 14:30:22 +0000 Subject: feat: custom primary colour variable --- src/response.rs | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/response.rs b/src/response.rs index 2cf0005..91764b9 100644 --- a/src/response.rs +++ b/src/response.rs @@ -164,6 +164,14 @@ For example: to proxy "gemini://fuwn.me/uptime", visit "/proxy/fuwn.me/uptime".< } } else if !is_nocss { html_context.push_str(&format!(r#""#)); + + if let Ok(primary) = var("PRIMARY_COLOUR") { + html_context + .push_str(&format!("")); + } else { + html_context + .push_str(""); + } } // Try to add an external favicon from the `FAVICON_EXTERNAL` environment @@ -256,17 +264,21 @@ For example: to proxy "gemini://fuwn.me/uptime", visit "/proxy/fuwn.me/uptime".< html_context.push_str(&format!( "
\nProxy Information
-
Original URL
{0}
+
Original URL
{0}
Status Code
{} ({})
-
Meta
{}
+
Meta
{}
\ +
Capsule Response Time
{} milliseconds
-
Gemini-to-HTML Time
+
Gemini-to-HTML \ + Time
{} milliseconds
-

This content has been proxied by \ -September ({}).

+

This content has been proxied \ + by September \ + ({}).

", url, response.status(), -- cgit v1.2.3