mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-29 14:56:36 +03:00
63 lines
1.1 KiB
Elm
63 lines
1.1 KiB
Elm
module Route.SPLAT__ exposing (Data, Model, Msg, route)
|
|
|
|
import DataSource
|
|
import Head
|
|
import Html.Styled exposing (text)
|
|
import Pages.PageUrl exposing (PageUrl)
|
|
import RouteBuilder exposing (StatefulRoute, StatelessRoute, StaticPayload)
|
|
import Shared
|
|
import View exposing (View)
|
|
|
|
|
|
type alias Model =
|
|
{}
|
|
|
|
|
|
type alias Msg =
|
|
()
|
|
|
|
|
|
type alias RouteParams =
|
|
{ splat : List String }
|
|
|
|
|
|
route : StatelessRoute RouteParams Data
|
|
route =
|
|
RouteBuilder.preRender
|
|
{ head = head
|
|
, pages = DataSource.succeed []
|
|
, data = data
|
|
|
|
--, routeFound = \_ -> DataSource.succeed True
|
|
}
|
|
|> RouteBuilder.buildNoState { view = view }
|
|
|
|
|
|
data : RouteParams -> DataSource.DataSource Data
|
|
data routeParams =
|
|
DataSource.succeed {}
|
|
|
|
|
|
head :
|
|
StaticPayload Data RouteParams
|
|
-> List Head.Tag
|
|
head static =
|
|
[]
|
|
|
|
|
|
type alias Data =
|
|
{}
|
|
|
|
|
|
view :
|
|
Maybe PageUrl
|
|
-> Shared.Model
|
|
-> StaticPayload Data RouteParams
|
|
-> View Msg
|
|
view maybeUrl sharedModel static =
|
|
{ body =
|
|
[ Debug.toString static.routeParams |> text
|
|
]
|
|
, title = "Fallback splat page"
|
|
}
|