♻️ Simple & Efficient Gemini-to-HTTP Proxy fuwn.net
proxy gemini-protocol protocol gemini http rust
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: custom primary colour variable

Fuwn e02923bf 7a4276e2

+41 -11
+16
Configuration.md
··· 144 144 <!-- Condensed --> 145 145 <p><a href="/">Link</a> | <a href="/">Link</a> | <a href="/">Link</a></p> 146 146 ``` 147 + 148 + ## `PRIMARY_COLOUR` 149 + 150 + Set the primary colour of elements in the default stylesheet. This field 151 + controls the colour of items such as links and highlights. 152 + 153 + Popular choices are `var(--base0D)` for a blue, or `var(--base09)` for an 154 + amber colour. 155 + 156 + ### Examples 157 + 158 + ```plaintext 159 + PRIMARY_COLOUR=var(--base09) 160 + PRIMARY_COLOUR=red 161 + PRIMARY_COLOUR=#ff0000 162 + ```
+8 -6
default.css
··· 5 5 --fg: var(--base04); 6 6 --off-fg: var(--base04); 7 7 --muted: var(--base03); 8 - --link: var(--base0D); 8 + --link: var(--primary); 9 9 --hover: var(--base0E); 10 - --highlight: var(--base0D); 11 - --logo: var(--base0D); 10 + --highlight: var(--primary); 11 + --logo: var(--primary); 12 12 --font-monospace: "Fira Mono", monospace; 13 13 --font-size: 13.5px; 14 14 } ··· 89 89 a:link, 90 90 a:visited { 91 91 color: var(--link); 92 + text-decoration: none; 92 93 } 93 94 94 95 a:hover, 95 96 a:active, 96 97 a.active { 97 - color: var(--hover); 98 + background-color: var(--link); 99 + color: var(--bg); 98 100 } 99 101 100 102 ul { ··· 267 269 } 268 270 } 269 271 270 - * { 272 + /* * { 271 273 transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, 272 274 border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; 273 - } 275 + } */
+17 -5
src/response.rs
··· 164 164 } 165 165 } else if !is_nocss { 166 166 html_context.push_str(&format!(r#"<link rel="stylesheet" href="https://latex.now.sh/style.css"><style>{CSS}</style>"#)); 167 + 168 + if let Ok(primary) = var("PRIMARY_COLOUR") { 169 + html_context 170 + .push_str(&format!("<style>:root {{ --primary: {primary} }}</style>")); 171 + } else { 172 + html_context 173 + .push_str("<style>:root { --primary: var(--base0D); }</style>"); 174 + } 167 175 } 168 176 169 177 // Try to add an external favicon from the `FAVICON_EXTERNAL` environment ··· 256 264 html_context.push_str(&format!( 257 265 "<details>\n<summary>Proxy Information</summary> 258 266 <dl> 259 - <dt>Original URL</dt><dd><a href=\"{}\">{0}</a></dd> 267 + <dt>Original URL</dt><dd><a \ 268 + href=\"{}\">{0}</a></dd> 260 269 <dt>Status Code</dt> 261 270 <dd>{} ({})</dd> 262 - <dt>Meta</dt><dd><code>{}</code></dd> 271 + <dt>Meta</dt><dd><code>{}</code></dd>\ 272 + 263 273 <dt>Capsule Response Time</dt> 264 274 <dd>{} milliseconds</dd> 265 - <dt>Gemini-to-HTML Time</dt> 275 + <dt>Gemini-to-HTML \ 276 + Time</dt> 266 277 <dd>{} milliseconds</dd> 267 278 </dl> 268 - <p>This content has been proxied by \ 269 - <a href=\"https://github.com/gemrest/september{}\">September ({})</a>.</p> 279 + <p>This content has been proxied \ 280 + by <a href=\"https://github.com/gemrest/september{}\">September \ 281 + ({})</a>.</p> 270 282 </details></body></html>", 271 283 url, 272 284 response.status(),