mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-26 13:21:42 +03:00
Remove obsolete argument.
This commit is contained in:
parent
e2c689da3f
commit
c1fb9c3436
@ -7,12 +7,10 @@ import Route exposing (Route)
|
||||
|
||||
|
||||
type alias SiteConfig data =
|
||||
List (Maybe Route)
|
||||
->
|
||||
{ data : DataSource data
|
||||
, canonicalUrl : String
|
||||
, manifest : data -> Pages.Manifest.Config
|
||||
, head :
|
||||
data
|
||||
-> List Head.Tag
|
||||
}
|
||||
{ data : DataSource data
|
||||
, canonicalUrl : String
|
||||
, manifest : data -> Pages.Manifest.Config
|
||||
, head :
|
||||
data
|
||||
-> List Head.Tag
|
||||
}
|
||||
|
@ -633,17 +633,12 @@ pathsToGenerateHandler =
|
||||
manifestHandler : ApiRoute.ApiRoute ApiRoute.Response
|
||||
manifestHandler =
|
||||
ApiRoute.succeed
|
||||
(getStaticRoutes
|
||||
|> DataSource.map (List.map Just)
|
||||
|> DataSource.andThen
|
||||
(\\resolvedRoutes ->
|
||||
Site.config resolvedRoutes
|
||||
|> .data
|
||||
|> DataSource.map
|
||||
(\\data ->
|
||||
(Site.config resolvedRoutes |> .manifest) data
|
||||
|> manifestToFile (Site.config resolvedRoutes |> .canonicalUrl)
|
||||
)
|
||||
(Site.config
|
||||
|> .data
|
||||
|> DataSource.map
|
||||
(\\data ->
|
||||
Site.config.manifest data
|
||||
|> manifestToFile (Site.config.canonicalUrl)
|
||||
)
|
||||
)
|
||||
|> ApiRoute.literal "manifest.json"
|
||||
|
@ -198,7 +198,7 @@ perform renderRequest config toJsPort effect =
|
||||
let
|
||||
canonicalSiteUrl : String
|
||||
canonicalSiteUrl =
|
||||
config.site [] |> .canonicalUrl
|
||||
config.site.canonicalUrl
|
||||
in
|
||||
case effect of
|
||||
Effect.NoEffect ->
|
||||
@ -669,14 +669,10 @@ nextStepToEffect contentCache config model ( updatedStaticResponsesModel, nextSt
|
||||
case pageFoundResult of
|
||||
Ok Nothing ->
|
||||
let
|
||||
allRoutes : List route
|
||||
allRoutes =
|
||||
[]
|
||||
|
||||
currentUrl : Url.Url
|
||||
currentUrl =
|
||||
{ protocol = Url.Https
|
||||
, host = config.site [] |> .canonicalUrl
|
||||
, host = config.site.canonicalUrl
|
||||
, port_ = Nothing
|
||||
, path = payload.path |> Path.toRelative
|
||||
, query = Nothing
|
||||
@ -755,7 +751,7 @@ nextStepToEffect contentCache config model ( updatedStaticResponsesModel, nextSt
|
||||
siteDataResult : Result BuildError siteData
|
||||
siteDataResult =
|
||||
StaticHttpRequest.resolve ApplicationType.Cli
|
||||
(config.site allRoutes |> .data)
|
||||
config.site.data
|
||||
(staticData |> Dict.map (\_ v -> Just v))
|
||||
|> Result.mapError (StaticHttpRequest.toBuildError "Site.elm")
|
||||
in
|
||||
@ -829,10 +825,6 @@ sendSinglePageProgress contentJson config model =
|
||||
model.allRawResponses
|
||||
|> Result.mapError (StaticHttpRequest.toBuildError currentUrl.path)
|
||||
|
||||
allRoutes : List route
|
||||
allRoutes =
|
||||
[]
|
||||
|
||||
renderedResult : Result BuildError { head : List Head.Tag, view : String, title : String }
|
||||
renderedResult =
|
||||
case includeHtml of
|
||||
@ -880,7 +872,7 @@ sendSinglePageProgress contentJson config model =
|
||||
currentUrl : Url.Url
|
||||
currentUrl =
|
||||
{ protocol = Url.Https
|
||||
, host = config.site allRoutes |> .canonicalUrl
|
||||
, host = config.site.canonicalUrl
|
||||
, port_ = Nothing
|
||||
, path = page |> Path.toRelative
|
||||
, query = Nothing
|
||||
@ -908,7 +900,7 @@ sendSinglePageProgress contentJson config model =
|
||||
siteDataResult : Result BuildError siteData
|
||||
siteDataResult =
|
||||
StaticHttpRequest.resolve ApplicationType.Cli
|
||||
(config.site allRoutes |> .data)
|
||||
config.site.data
|
||||
(contentJson |> Dict.map (\_ v -> Just v))
|
||||
|> Result.mapError (StaticHttpRequest.toBuildError "Site.elm")
|
||||
in
|
||||
@ -920,7 +912,7 @@ sendSinglePageProgress contentJson config model =
|
||||
, contentJson = contentJson
|
||||
, html = rendered.view
|
||||
, errors = []
|
||||
, head = rendered.head ++ (config.site allRoutes |> .head) siteData
|
||||
, head = rendered.head ++ config.site.head siteData
|
||||
, title = rendered.title
|
||||
, staticHttpCache = model.allRawResponses |> Dict.Extra.filterMap (\_ v -> v)
|
||||
, is404 = False
|
||||
|
@ -189,7 +189,7 @@ nextStep :
|
||||
, routeToPath : route -> List String
|
||||
, data : route -> DataSource pageData
|
||||
, sharedData : DataSource sharedData
|
||||
, site : SiteConfig route siteData
|
||||
, site : SiteConfig siteData
|
||||
, apiRoutes : (Html Never -> String) -> List (ApiRoute.ApiRoute ApiRoute.Response)
|
||||
}
|
||||
->
|
||||
|
@ -52,7 +52,7 @@ type alias ProgramConfig userMsg userModel route siteData pageData sharedData =
|
||||
, getStaticRoutes : DataSource.DataSource (List route)
|
||||
, urlToRoute : Url -> route
|
||||
, routeToPath : route -> List String
|
||||
, site : SiteConfig route siteData
|
||||
, site : SiteConfig siteData
|
||||
, toJsPort : Json.Encode.Value -> Cmd Never
|
||||
, fromJsPort : Sub Decode.Value
|
||||
, onPageChange :
|
||||
|
@ -5,13 +5,9 @@ import Head
|
||||
import Pages.Manifest
|
||||
|
||||
|
||||
type alias SiteConfig route data =
|
||||
List route
|
||||
->
|
||||
{ data : DataSource data
|
||||
, canonicalUrl : String
|
||||
, manifest : data -> Pages.Manifest.Config
|
||||
, head :
|
||||
data
|
||||
-> List Head.Tag
|
||||
}
|
||||
type alias SiteConfig data =
|
||||
{ data : DataSource data
|
||||
, canonicalUrl : String
|
||||
, manifest : data -> Pages.Manifest.Config
|
||||
, head : data -> List Head.Tag
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user