mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-24 15:12:01 +03:00
Remove hardcoding of init function.
This commit is contained in:
parent
15a8881eec
commit
56028a1d41
@ -117,30 +117,12 @@ init maybePagePath =
|
||||
|
||||
Just meta ->
|
||||
case meta of
|
||||
M.MetadataBlogPost metadata ->
|
||||
Template.BlogPost.template.init metadata
|
||||
${templates.map(name => `M.Metadata${name} metadata ->
|
||||
Template.${name}.template.init metadata
|
||||
|> Tuple.first
|
||||
|> ModelBlogPost
|
||||
|> Model${name}
|
||||
|
||||
M.MetadataShowcase metadata ->
|
||||
Template.Showcase.template.init metadata
|
||||
|> Tuple.first
|
||||
|> ModelShowcase
|
||||
|
||||
M.MetadataPage metadata ->
|
||||
Template.Page.template.init metadata
|
||||
|> Tuple.first
|
||||
|> ModelPage
|
||||
|
||||
M.MetadataBlogIndex metadata ->
|
||||
Template.BlogIndex.template.init metadata
|
||||
|> Tuple.first
|
||||
|> ModelBlogIndex
|
||||
|
||||
M.MetadataDocumentation metadata ->
|
||||
Template.Documentation.template.init metadata
|
||||
|> Tuple.first
|
||||
|> ModelDocumentation
|
||||
`).join("\n ")}
|
||||
}
|
||||
, Cmd.none
|
||||
)
|
||||
|
@ -379,30 +379,36 @@ init maybePagePath =
|
||||
|
||||
Just meta ->
|
||||
case meta of
|
||||
M.MetadataBlogIndex metadata ->
|
||||
Template.BlogIndex.template.init metadata
|
||||
|> Tuple.first
|
||||
|> ModelBlogIndex
|
||||
|
||||
|
||||
M.MetadataBlogPost metadata ->
|
||||
Template.BlogPost.template.init metadata
|
||||
|> Tuple.first
|
||||
|> ModelBlogPost
|
||||
|
||||
M.MetadataShowcase metadata ->
|
||||
Template.Showcase.template.init metadata
|
||||
|
||||
M.MetadataDocumentation metadata ->
|
||||
Template.Documentation.template.init metadata
|
||||
|> Tuple.first
|
||||
|> ModelShowcase
|
||||
|> ModelDocumentation
|
||||
|
||||
|
||||
M.MetadataPage metadata ->
|
||||
Template.Page.template.init metadata
|
||||
|> Tuple.first
|
||||
|> ModelPage
|
||||
|
||||
M.MetadataBlogIndex metadata ->
|
||||
Template.BlogIndex.template.init metadata
|
||||
|> Tuple.first
|
||||
|> ModelBlogIndex
|
||||
|
||||
M.MetadataDocumentation metadata ->
|
||||
Template.Documentation.template.init metadata
|
||||
M.MetadataShowcase metadata ->
|
||||
Template.Showcase.template.init metadata
|
||||
|> Tuple.first
|
||||
|> ModelDocumentation
|
||||
|> ModelShowcase
|
||||
|
||||
|
||||
}
|
||||
, Cmd.none
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user