mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-24 06:54:03 +03:00
Hardcode empty generate files as a first step before actually performing the static http requests.
This commit is contained in:
parent
1261b83d96
commit
1bc941de89
@ -601,11 +601,13 @@ application :
|
||||
, body : String
|
||||
}
|
||||
->
|
||||
List
|
||||
(Result String
|
||||
{ path : List String
|
||||
, content : String
|
||||
}
|
||||
StaticHttp.Request
|
||||
(List
|
||||
(Result String
|
||||
{ path : List String
|
||||
, content : String
|
||||
}
|
||||
)
|
||||
)
|
||||
, canonicalSiteUrl : String
|
||||
, pathKey : pathKey
|
||||
@ -711,11 +713,13 @@ cliApplication :
|
||||
, body : String
|
||||
}
|
||||
->
|
||||
List
|
||||
(Result String
|
||||
{ path : List String
|
||||
, content : String
|
||||
}
|
||||
StaticHttp.Request
|
||||
(List
|
||||
(Result String
|
||||
{ path : List String
|
||||
, content : String
|
||||
}
|
||||
)
|
||||
)
|
||||
, canonicalSiteUrl : String
|
||||
, pathKey : pathKey
|
||||
|
@ -186,11 +186,13 @@ type alias Config pathKey userMsg userModel metadata view =
|
||||
, body : String
|
||||
}
|
||||
->
|
||||
List
|
||||
(Result String
|
||||
{ path : List String
|
||||
, content : String
|
||||
}
|
||||
StaticHttp.Request
|
||||
(List
|
||||
(Result String
|
||||
{ path : List String
|
||||
, content : String
|
||||
}
|
||||
)
|
||||
)
|
||||
, canonicalSiteUrl : String
|
||||
, pathKey : pathKey
|
||||
@ -795,6 +797,8 @@ sendStaticResponsesIfDone config siteMetadata mode secrets allRawResponses error
|
||||
updatedAllRawResponses =
|
||||
Dict.empty
|
||||
|
||||
--generatedFiles : StaticHttp.Request (List (Result String { path : List String, content : String }))
|
||||
--generatedFiles : List (Result String { path : List String, content : String })
|
||||
generatedFiles =
|
||||
siteMetadata
|
||||
|> Result.withDefault []
|
||||
@ -826,8 +830,28 @@ sendStaticResponsesIfDone config siteMetadata mode secrets allRawResponses error
|
||||
, body = contentForPage |> Maybe.withDefault ""
|
||||
}
|
||||
)
|
||||
|> config.generateFiles
|
||||
|> newThing
|
||||
|
||||
newThing :
|
||||
List
|
||||
{ path : PagePath pathKey
|
||||
, frontmatter : metadata
|
||||
, body : String
|
||||
}
|
||||
->
|
||||
List
|
||||
(Result String
|
||||
{ path : List String
|
||||
, content : String
|
||||
}
|
||||
)
|
||||
newThing =
|
||||
-- @@@@@@@@@@@ TODO
|
||||
--|> config.generateFiles
|
||||
--config.generateFiles
|
||||
\_ -> []
|
||||
|
||||
generatedOkayFiles : List { path : List String, content : String }
|
||||
generatedOkayFiles =
|
||||
generatedFiles
|
||||
|> List.filterMap
|
||||
@ -840,6 +864,7 @@ sendStaticResponsesIfDone config siteMetadata mode secrets allRawResponses error
|
||||
Nothing
|
||||
)
|
||||
|
||||
generatedFileErrors : List { title : String, message : List Terminal.Text, fatal : Bool }
|
||||
generatedFileErrors =
|
||||
generatedFiles
|
||||
|> List.filterMap
|
||||
|
@ -90,11 +90,13 @@ application :
|
||||
, body : String
|
||||
}
|
||||
->
|
||||
List
|
||||
(Result String
|
||||
{ path : List String
|
||||
, content : String
|
||||
}
|
||||
StaticHttp.Request
|
||||
(List
|
||||
(Result String
|
||||
{ path : List String
|
||||
, content : String
|
||||
}
|
||||
)
|
||||
)
|
||||
, onPageChange :
|
||||
{ path : PagePath pathKey
|
||||
|
@ -638,7 +638,7 @@ start pages =
|
||||
config =
|
||||
{ toJsPort = toJsPort
|
||||
, manifest = manifest
|
||||
, generateFiles = \_ -> []
|
||||
, generateFiles = \_ -> StaticHttp.succeed []
|
||||
, init = \_ -> ( (), Cmd.none )
|
||||
, update = \_ _ -> ( (), Cmd.none )
|
||||
, view =
|
||||
|
Loading…
Reference in New Issue
Block a user