2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-07-01 08:42:04 +00:00

fix: routing for index pages

This commit is contained in:
sammyette 2025-06-12 19:52:33 -04:00
parent 681e1127f4
commit d73ae7fb99
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD

View File

@ -116,16 +116,12 @@ pub fn main() {
|> ssg.add_static_dir("static")
|> ssg.add_static_route("/", create_page(index.page()))
|> list.fold(posts, _, fn(config, post) {
let route = case { post.1 }.name {
"_index" -> post.0 |> string.drop_end("_index" |> string.length())
_ -> post.0
}
let page = case is_doc_page(post.0) {
True -> doc.page(post.1, doc_pages)
False -> doc.page(post.1, doc_pages)
}
ssg.add_static_route(config, route, create_page(page))
io.debug(post.0)
ssg.add_static_route(config, post.0, create_page(page))
})
|> ssg.use_index_routes
|> ssg.build