2021-04-15 03:17:22 +03:00
|
|
|
## elm-pages 2.0
|
2021-04-14 17:33:51 +03:00
|
|
|
|
2021-04-15 03:17:22 +03:00
|
|
|
```
|
2021-10-10 18:58:28 +03:00
|
|
|
elm-pages add Projects.Username_.Repo_
|
2021-04-15 03:17:22 +03:00
|
|
|
```
|
|
|
|
|
2021-04-14 19:58:35 +03:00
|
|
|
```elm
|
2021-04-15 03:17:22 +03:00
|
|
|
type alias RouteParams =
|
|
|
|
{ username : String, repo : String }
|
|
|
|
|
2021-10-13 21:08:56 +03:00
|
|
|
page : Page RouteParams StaticData
|
|
|
|
page =
|
|
|
|
Page.noStaticData
|
2021-04-15 03:17:22 +03:00
|
|
|
{ head = head
|
|
|
|
, staticRoutes = StaticHttp.succeed []
|
|
|
|
}
|
2021-10-13 21:08:56 +03:00
|
|
|
|> Page.buildNoState { view = view }
|
2021-04-15 03:17:22 +03:00
|
|
|
|
|
|
|
|
|
|
|
view :
|
|
|
|
StaticPayload StaticData RouteParams
|
|
|
|
-> Document Msg
|
|
|
|
view static =
|
|
|
|
{ title = "TODO title"
|
|
|
|
, body = []
|
|
|
|
}
|
2021-04-14 19:58:35 +03:00
|
|
|
```
|
|
|
|
|
2021-04-15 03:17:22 +03:00
|
|
|
## Core Concepts
|
|
|
|
|
2021-10-13 21:08:56 +03:00
|
|
|
- Page Modules (`Page.*.elm`)
|
2023-01-02 01:44:11 +03:00
|
|
|
- `BackendTask`s
|
2021-04-15 03:17:22 +03:00
|
|
|
- `Shared.elm`, `Site.elm`
|