Skip to content

Commit 49998f0

Browse files
authored
Merge pull request #2190 from Kobzol/fix-redirects
Fix endless redirect in index page
2 parents ea2830a + d519f26 commit 49998f0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/redirect.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ pub static PAGE_REDIRECTS: &[(&str, &str)] = &[
1717
("documentation.html", "learn"),
1818
("downloads.html", "tools/install"),
1919
("friends.html", "production"),
20-
("index.html", ""),
2120
("install.html", "tools/install"),
2221
("legal.html", "policies"),
2322
("security.html", "policies/security"),

src/render.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ impl<'a, T: Serialize> PageCtx<'a, T> {
5050

5151
let out_path = self.output_dir.join(path);
5252
ensure_directory(&out_path)?;
53+
54+
if out_path.is_file() {
55+
return Err(anyhow::anyhow!(
56+
"Trying to render file {}, which already exists",
57+
out_path.display()
58+
));
59+
}
60+
5361
let mut output_file = BufWriter::new(
5462
File::create(&out_path)
5563
.with_context(|| anyhow::anyhow!("Cannot create file at {}", path.display()))?,

0 commit comments

Comments
 (0)