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
|
|
|
```
|
|
|
|
elm-pages generate Projects.Username_.Repo_
|
|
|
|
```
|
|
|
|
|
2021-04-14 19:58:35 +03:00
|
|
|
```elm
|
2021-04-15 03:17:22 +03:00
|
|
|
type alias RouteParams =
|
|
|
|
{ username : String, repo : String }
|
|
|
|
|
|
|
|
template : Template RouteParams StaticData
|
|
|
|
template =
|
|
|
|
Template.noStaticData
|
|
|
|
{ head = head
|
|
|
|
, staticRoutes = StaticHttp.succeed []
|
|
|
|
}
|
|
|
|
|> Template.buildNoState { view = view }
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
- Page Templates (`Template.*.elm`)
|
|
|
|
- `DataSource`s
|
|
|
|
- `Shared.elm`, `Site.elm`
|
|
|
|
|
|
|
|
## Page Templates
|
2021-04-14 17:33:51 +03:00
|
|
|
|
|
|
|
Here's another body
|