mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-25 04:43:03 +03:00
Update docs site.
This commit is contained in:
parent
1ba5431a94
commit
83fb3942f3
@ -3,6 +3,7 @@ module Effect exposing (Effect(..), batch, fromCmd, map, none, perform)
|
||||
import Browser.Navigation
|
||||
import Bytes exposing (Bytes)
|
||||
import Bytes.Decode
|
||||
import FormDecoder
|
||||
import Http
|
||||
import Json.Decode as Decode
|
||||
import Pages.Fetcher
|
||||
@ -15,14 +16,11 @@ type Effect msg
|
||||
| Batch (List (Effect msg))
|
||||
| GetStargazers (Result Http.Error Int -> msg)
|
||||
| FetchRouteData
|
||||
{ body : Maybe { contentType : String, body : String }
|
||||
, path : Maybe String
|
||||
{ data : Maybe FormDecoder.FormData
|
||||
, toMsg : Result Http.Error Url -> msg
|
||||
}
|
||||
| Submit
|
||||
{ values : List ( String, String )
|
||||
, path : Maybe (List String)
|
||||
, method : Maybe String
|
||||
{ values : FormDecoder.FormData
|
||||
, toMsg : Result Http.Error Url -> msg
|
||||
}
|
||||
| SubmitFetcher (Pages.Fetcher.Fetcher msg)
|
||||
@ -66,16 +64,13 @@ map fn effect =
|
||||
|
||||
FetchRouteData fetchInfo ->
|
||||
FetchRouteData
|
||||
{ body = fetchInfo.body
|
||||
, path = fetchInfo.path
|
||||
{ data = fetchInfo.data
|
||||
, toMsg = fetchInfo.toMsg >> fn
|
||||
}
|
||||
|
||||
Submit fetchInfo ->
|
||||
Submit
|
||||
{ values = fetchInfo.values
|
||||
, path = fetchInfo.path
|
||||
, method = fetchInfo.method
|
||||
, toMsg = fetchInfo.toMsg >> fn
|
||||
}
|
||||
|
||||
@ -87,16 +82,12 @@ map fn effect =
|
||||
|
||||
perform :
|
||||
{ fetchRouteData :
|
||||
{ body : Maybe { contentType : String, body : String }
|
||||
, path : Maybe String
|
||||
{ data : Maybe FormDecoder.FormData
|
||||
, toMsg : Result Http.Error Url -> pageMsg
|
||||
}
|
||||
-> Cmd msg
|
||||
, submit :
|
||||
{ values : List ( String, String )
|
||||
, encType : Maybe String
|
||||
, method : Maybe String
|
||||
, path : Maybe String
|
||||
{ values : FormDecoder.FormData
|
||||
, toMsg : Result Http.Error Url -> pageMsg
|
||||
}
|
||||
-> Cmd msg
|
||||
@ -128,19 +119,10 @@ perform ({ fromPageMsg, key } as helpers) effect =
|
||||
|
||||
FetchRouteData fetchInfo ->
|
||||
helpers.fetchRouteData
|
||||
{ body = fetchInfo.body
|
||||
, path = fetchInfo.path
|
||||
, toMsg = fetchInfo.toMsg
|
||||
}
|
||||
fetchInfo
|
||||
|
||||
Submit record ->
|
||||
helpers.submit
|
||||
{ values = record.values
|
||||
, path = Nothing --fetchInfo.path
|
||||
, method = record.method
|
||||
, encType = Nothing -- TODO
|
||||
, toMsg = record.toMsg
|
||||
}
|
||||
helpers.submit record
|
||||
|
||||
SubmitFetcher record ->
|
||||
helpers.runFetcher record
|
||||
|
@ -14,6 +14,7 @@ import Json.Decode.Extra
|
||||
import Markdown.Block
|
||||
import Markdown.Renderer
|
||||
import MarkdownCodec
|
||||
import Pages.Msg
|
||||
import Pages.PageUrl exposing (PageUrl)
|
||||
import Pages.Url
|
||||
import Path
|
||||
@ -64,7 +65,7 @@ view :
|
||||
Maybe PageUrl
|
||||
-> Shared.Model
|
||||
-> StaticPayload Data ActionData RouteParams
|
||||
-> View Msg
|
||||
-> View (Pages.Msg.Msg Msg)
|
||||
view maybeUrl sharedModel static =
|
||||
{ title = static.data.metadata.title
|
||||
, body =
|
||||
|
@ -17,6 +17,7 @@ import Markdown.Parser
|
||||
import Markdown.Renderer
|
||||
import MarkdownCodec
|
||||
import NextPrevious
|
||||
import Pages.Msg
|
||||
import Pages.PageUrl exposing (PageUrl)
|
||||
import Pages.Url
|
||||
import RouteBuilder exposing (StatelessRoute, StaticPayload)
|
||||
@ -198,7 +199,7 @@ view :
|
||||
Maybe PageUrl
|
||||
-> Shared.Model
|
||||
-> StaticPayload Data ActionData RouteParams
|
||||
-> View Msg
|
||||
-> View (Pages.Msg.Msg Msg)
|
||||
view maybeUrl sharedModel static =
|
||||
{ title = static.data.titles.title ++ " - elm-pages docs"
|
||||
, body =
|
||||
|
@ -4,9 +4,10 @@ import Css
|
||||
import DataSource exposing (DataSource)
|
||||
import Head
|
||||
import Head.Seo as Seo
|
||||
import Html.Styled exposing (..)
|
||||
import Html.Styled as Html exposing (..)
|
||||
import Html.Styled.Attributes as Attr exposing (css)
|
||||
import Link
|
||||
import Pages.Msg
|
||||
import Pages.PageUrl exposing (PageUrl)
|
||||
import Pages.Url
|
||||
import Path
|
||||
@ -75,11 +76,11 @@ view :
|
||||
Maybe PageUrl
|
||||
-> Shared.Model
|
||||
-> StaticPayload Data ActionData RouteParams
|
||||
-> View Msg
|
||||
-> View (Pages.Msg.Msg Msg)
|
||||
view maybeUrl sharedModel static =
|
||||
{ title = "elm-pages - a statically typed site generator"
|
||||
, body =
|
||||
[ landingView
|
||||
[ landingView |> Html.map Pages.Msg.UserMsg
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ import Head
|
||||
import Head.Seo as Seo
|
||||
import Html.Styled exposing (..)
|
||||
import Html.Styled.Attributes as Attr exposing (css, href)
|
||||
import Pages.Msg
|
||||
import Pages.PageUrl exposing (PageUrl)
|
||||
import Pages.Url
|
||||
import Path
|
||||
@ -55,7 +56,7 @@ view :
|
||||
Maybe PageUrl
|
||||
-> Shared.Model
|
||||
-> StaticPayload Data ActionData {}
|
||||
-> View Msg
|
||||
-> View (Pages.Msg.Msg Msg)
|
||||
view maybeUrl sharedModel static =
|
||||
{ title = "elm-pages blog"
|
||||
, body =
|
||||
|
Loading…
Reference in New Issue
Block a user