[WIP] A (somewhat barebones) atproto app for creating custom sites without hosting!

upload: fix edge case for /index.html

tldr: the key mapper stripped /index.html, to ensure the entire segment was an index.html at the end and to avoid conflict
because the root of the site wasnt prefixed with a / before mapping, a path of index.html would just get mapped to path /index.html instead of /
fix: add special case for index.html
also make it a map bc more special cases may be added

vielle.dev 293879b2 66798d90

verified
Changed files
+6 -6
upload
+1 -1
upload/Cargo.lock
··· 163 163 164 164 [[package]] 165 165 name = "atcities-upload" 166 - version = "1.0.0" 166 + version = "1.0.1" 167 167 dependencies = [ 168 168 "clap", 169 169 "env_logger",
+1 -1
upload/Cargo.toml
··· 4 4 5 5 [package] 6 6 name = "atcities-upload" 7 - version = "1.0.0" 7 + version = "1.0.1" 8 8 edition = "2024" 9 9 10 10 [dependencies]
+4 -4
upload/src/main.rs
··· 179 179 let mut create_records = new_sitemap 180 180 .into_iter() 181 181 .map(|(k, v)| { 182 - let k = if k == "404.html" { 183 - String::from("404") 184 - } else { 185 - match k.strip_suffix("/index.html") { 182 + let k = match k.as_str() { 183 + "404.html" => String::from("404"), 184 + "index.html" => String::from("/"), 185 + _ => match k.strip_suffix("/index.html") { 186 186 Some(k) => format!("/{k}/"), 187 187 None => format!("/{k}"), 188 188 }