Hardcode empty generate files as a first step before actually performing the static http requests.

This commit is contained in:
Dillon Kearns 2020-03-07 11:28:13 -08:00
parent 1261b83d96
commit 1bc941de89
4 changed files with 53 additions and 22 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -638,7 +638,7 @@ start pages =
config =
{ toJsPort = toJsPort
, manifest = manifest
, generateFiles = \_ -> []
, generateFiles = \_ -> StaticHttp.succeed []
, init = \_ -> ( (), Cmd.none )
, update = \_ _ -> ( (), Cmd.none )
, view =