Remove more hardcoding.

This commit is contained in:
Dillon Kearns 2021-04-15 13:30:27 -07:00
parent 2cbea63fe1
commit 01c096a1af

View File

@ -372,12 +372,21 @@ main =
staticDataForRoute : Maybe Route -> StaticHttp.Request PageStaticData
staticDataForRoute route =
case route of
Just (Route.Slide__Number_ routeParams) ->
Template.Slide.Number_.template.staticData routeParams
|> StaticHttp.map DataSlide__Number_
Nothing ->
StaticHttp.fail ""
${templates
.map(
(name) =>
`Just (Route.${routeHelpers.routeVariant(
name
)} routeParams) ->\n Template.${name.join(
"."
)}.template.staticData routeParams |> StaticHttp.map Data${routeHelpers.routeVariant(
name
)}`
)
.join("\n ")}
getStaticRoutes : StaticHttp.Request (List (Maybe Route))
getStaticRoutes =