@@ -17,11 +17,11 @@ pub fn main() {
17
17
let build =
18
18
ssg . new ( "./priv" )
19
19
|> ssg . add_static_route ( "/" , index . view ( ) )
20
- |> ssg . add_static_route ( "/about" , about . view ( ) )
21
- |> ssg . add_static_route ( "/commissions" , commissions . view ( ) )
22
- |> ssg . add_static_route ( "/contact" , contact . view ( ) )
20
+ |> add_static_route ( "/about" , about . view ( ) )
21
+ |> add_static_route ( "/commissions" , commissions . view ( ) )
22
+ |> add_static_route ( "/contact" , contact . view ( ) )
23
23
|> ssg . add_static_dir ( "./static" )
24
- |> ssg . add_static_route ( "/projects/index " , projects_page . view ( categories ) )
24
+ |> add_static_route ( "/projects" , projects_page . view ( categories ) )
25
25
|> add_dynamic_routes (
26
26
categories ,
27
27
project . view ,
@@ -50,3 +50,11 @@ fn add_dynamic_routes(
50
50
let # ( base , dict ) = map_fn ( element )
51
51
ssg . add_dynamic_route ( config , base , dict , view )
52
52
}
53
+
54
+ fn add_static_route (
55
+ config : ssg . Config ( a, b, c) ,
56
+ route : String ,
57
+ view : Element ( d) ,
58
+ ) -> ssg . Config ( ssg . HasStaticRoutes , b, c) {
59
+ ssg . add_static_route ( config , route <> "/index" , view )
60
+ }
0 commit comments