From 8f0a36eeb8ee96b9966274e1c1cea06356b5b99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Tue, 16 Sep 2025 13:19:45 +0200 Subject: [PATCH 1/2] Remove invalid redirect --- src/redirect.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/redirect.rs b/src/redirect.rs index ff45a546..5909ada0 100644 --- a/src/redirect.rs +++ b/src/redirect.rs @@ -17,7 +17,6 @@ pub static PAGE_REDIRECTS: &[(&str, &str)] = &[ ("documentation.html", "learn"), ("downloads.html", "tools/install"), ("friends.html", "production"), - ("index.html", ""), ("install.html", "tools/install"), ("legal.html", "policies"), ("security.html", "policies/security"), From d519f26221ea79ad3088171715988f1d909268e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Tue, 16 Sep 2025 13:19:59 +0200 Subject: [PATCH 2/2] Add a check to make sure that we don't render the same file twice --- src/render.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/render.rs b/src/render.rs index e0a39d22..e87ba954 100644 --- a/src/render.rs +++ b/src/render.rs @@ -50,6 +50,14 @@ impl<'a, T: Serialize> PageCtx<'a, T> { let out_path = self.output_dir.join(path); ensure_directory(&out_path)?; + + if out_path.is_file() { + return Err(anyhow::anyhow!( + "Trying to render file {}, which already exists", + out_path.display() + )); + } + let mut output_file = BufWriter::new( File::create(&out_path) .with_context(|| anyhow::anyhow!("Cannot create file at {}", path.display()))?,