aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md11
-rw-r--r--src/response.rs5
2 files changed, 16 insertions, 0 deletions
diff --git a/README.md b/README.md
index 4196ab9..4f97859 100644
--- a/README.md
+++ b/README.md
@@ -143,6 +143,17 @@ Defaults to `false`.
MATHJAX=true
```
+### `HEADER`
+
+Adds a large header to the top of a proxy page. Only available in styled
+routes.
+
+Defaults to off.
+
+```dotenv
+HEADER="This will show up at the top of my proxied capsule."
+```
+
## Styling
Want to give your website a shiny new look? Try using one of sources
diff --git a/src/response.rs b/src/response.rs
index d7142c4..f156603 100644
--- a/src/response.rs
+++ b/src/response.rs
@@ -184,6 +184,11 @@ For example: to proxy "gemini://fuwn.me/uptime", visit "/proxy/fuwn.me/uptime".<
html_context.push_str(&format!("<title>{gemini_title}</title>"));
html_context.push_str("</head><body>");
+ if let Ok(header) = var("HEADER") {
+ html_context
+ .push_str(&format!("<big><blockquote>{header}</blockquote></big>"));
+ }
+
match response.status() {
germ::request::Status::Success => {
html_context.push_str(&gemini_html.1);