mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-27 22:01:48 +03:00
Rename frontmatter to route.
This commit is contained in:
parent
182fb89ddf
commit
aafd5a29e5
@ -30,7 +30,7 @@ type alias SharedTemplate msg sharedModel sharedData sharedMsg mappedMsg =
|
||||
sharedData
|
||||
->
|
||||
{ path : Path
|
||||
, frontmatter : Maybe Route
|
||||
, route : Maybe Route
|
||||
}
|
||||
-> sharedModel
|
||||
-> (msg -> mappedMsg)
|
||||
|
@ -129,7 +129,7 @@ type PageData
|
||||
|
||||
view :
|
||||
{ path : Path
|
||||
, frontmatter : Maybe Route
|
||||
, route : Maybe Route
|
||||
}
|
||||
-> Maybe PageUrl
|
||||
-> Shared.Data
|
||||
@ -139,7 +139,7 @@ view :
|
||||
, head : List Head.Tag
|
||||
}
|
||||
view page maybePageUrl globalData pageData =
|
||||
case ( page.frontmatter, pageData ) of
|
||||
case ( page.route, pageData ) of
|
||||
${templates
|
||||
.map(
|
||||
(name) =>
|
||||
|
@ -6,6 +6,7 @@ import Html exposing (Html)
|
||||
import Pages.Flags
|
||||
import Pages.PageUrl exposing (PageUrl)
|
||||
import Path exposing (Path)
|
||||
import Route exposing (Route)
|
||||
import SharedTemplate exposing (SharedTemplate)
|
||||
import View exposing (View)
|
||||
|
||||
@ -88,7 +89,7 @@ view :
|
||||
Data
|
||||
->
|
||||
{ path : Path
|
||||
, frontmatter : route
|
||||
, route : Maybe Route
|
||||
}
|
||||
-> Model
|
||||
-> (Msg -> msg)
|
||||
|
@ -48,7 +48,7 @@ mainView config model =
|
||||
Ok pageData ->
|
||||
(config.view
|
||||
{ path = ContentCache.pathForUrl urls |> Path.join
|
||||
, frontmatter = config.urlToRoute model.url
|
||||
, route = config.urlToRoute model.url
|
||||
}
|
||||
Nothing
|
||||
pageData.sharedData
|
||||
|
@ -710,7 +710,7 @@ nextStepToEffect contentCache config model ( updatedStaticResponsesModel, nextSt
|
||||
, query = Nothing
|
||||
, fragment = Nothing
|
||||
}
|
||||
, metadata = currentPage.frontmatter
|
||||
, metadata = currentPage.route
|
||||
, pageUrl = Nothing
|
||||
}
|
||||
)
|
||||
@ -733,9 +733,9 @@ nextStepToEffect contentCache config model ( updatedStaticResponsesModel, nextSt
|
||||
-- |> Maybe.withDefault Dict.empty
|
||||
Dict.empty
|
||||
|
||||
currentPage : { path : Path, frontmatter : route }
|
||||
currentPage : { path : Path, route : route }
|
||||
currentPage =
|
||||
{ path = payload.path, frontmatter = config.urlToRoute currentUrl }
|
||||
{ path = payload.path, route = config.urlToRoute currentUrl }
|
||||
|
||||
pageDataResult : Result BuildError pageData
|
||||
pageDataResult =
|
||||
@ -866,7 +866,7 @@ sendSinglePageProgress toJsPayload config model =
|
||||
, query = Nothing
|
||||
, fragment = Nothing
|
||||
}
|
||||
, metadata = currentPage.frontmatter
|
||||
, metadata = currentPage.route
|
||||
, pageUrl = Nothing
|
||||
}
|
||||
)
|
||||
@ -898,9 +898,9 @@ sendSinglePageProgress toJsPayload config model =
|
||||
|> Dict.get (Path.toRelative page)
|
||||
|> Maybe.withDefault Dict.empty
|
||||
|
||||
currentPage : { path : Path, frontmatter : route }
|
||||
currentPage : { path : Path, route : route }
|
||||
currentPage =
|
||||
{ path = page, frontmatter = config.urlToRoute currentUrl }
|
||||
{ path = page, route = config.urlToRoute currentUrl }
|
||||
|
||||
pageDataResult : Result BuildError pageData
|
||||
pageDataResult =
|
||||
|
@ -39,7 +39,7 @@ type alias ProgramConfig userMsg userModel route siteData pageData sharedData =
|
||||
, data : route -> DataSource.DataSource pageData
|
||||
, view :
|
||||
{ path : Path
|
||||
, frontmatter : route
|
||||
, route : route
|
||||
}
|
||||
-> Maybe PageUrl
|
||||
-> sharedData
|
||||
|
Loading…
Reference in New Issue
Block a user