From 60587457a412ec754d0e56915fe840169e3fea0f Mon Sep 17 00:00:00 2001 From: Sachymetsu Date: Wed, 16 Sep 2026 14:53:31 +0200 Subject: [PATCH] CSS template for hidden links --- crates/nailgen/src/html_gen.rs | 10 ++++++++- crates/nailgen/src/lib.rs | 28 ++++++++++++++---------- crates/nailgen/src/template.rs | 4 ++++ templates/generated.html | 40 ++++++++++++++++------------------ templates/warning.html | 38 ++++++++++++++++---------------- 5 files changed, 68 insertions(+), 52 deletions(-) diff --git a/crates/nailgen/src/html_gen.rs b/crates/nailgen/src/html_gen.rs index 6295c65..582eee4 100644 --- a/crates/nailgen/src/html_gen.rs +++ b/crates/nailgen/src/html_gen.rs @@ -6,6 +6,8 @@ use nailkov::NailKov; use nailrng::FastRng; use rand::{Rng, RngExt, distr::Alphanumeric, seq::IndexedRandom}; +static LINK_CSS: &str = ""; + /// Provides either the minimum configured size, or a randomised value between /// the minimum and maximum configured sizes if a maximum is available. #[inline] @@ -60,6 +62,12 @@ pub fn static_content<'a>(text: &'a str) -> impl Iterator + 'a { .flat_map(|bytes| b"

".iter().chain(bytes).chain(b"

\n")) } +pub fn css_content(buffer: &mut Vec) -> usize { + buffer.extend_from_slice(LINK_CSS.as_bytes()); + + LINK_CSS.len() +} + pub async fn initial_content( buf_mut: Vec, chain: Arc, @@ -144,7 +152,7 @@ pub async fn footer( let is_not_root = path != "/"; - buf_mut.extend_from_slice(b"