mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-29 14:56:36 +03:00
Change argument order to make function more pipeline-friendly.
This commit is contained in:
parent
44d6811f71
commit
5b6ad1d615
@ -11,11 +11,11 @@ import Serialize as S
|
||||
|
||||
withFrontmatter :
|
||||
(frontmatter -> List view -> value)
|
||||
-> String
|
||||
-> Decoder frontmatter
|
||||
-> Markdown.Renderer.Renderer view
|
||||
-> String
|
||||
-> DataSource.DataSource value
|
||||
withFrontmatter constructor filePath frontmatterDecoder renderer =
|
||||
withFrontmatter constructor frontmatterDecoder renderer filePath =
|
||||
DataSource.map2 constructor
|
||||
(StaticFile.onlyFrontmatter
|
||||
frontmatterDecoder
|
||||
|
@ -234,9 +234,9 @@ type alias Data =
|
||||
data : RouteParams -> DataSource Data
|
||||
data route =
|
||||
MarkdownCodec.withFrontmatter Data
|
||||
("content/blog/" ++ route.slug ++ ".md")
|
||||
frontmatterDecoder
|
||||
TailwindMarkdownRenderer.renderer
|
||||
("content/blog/" ++ route.slug ++ ".md")
|
||||
|
||||
|
||||
type alias ArticleMetadata =
|
||||
|
@ -283,11 +283,9 @@ pageBody routeParams =
|
||||
in
|
||||
Glob.expectUniqueMatch (findBySlug slug)
|
||||
|> DataSource.andThen
|
||||
(\filePath ->
|
||||
MarkdownCodec.withFrontmatter (\description body -> { description = description, body = body })
|
||||
filePath
|
||||
(Decode.field "description" Decode.string)
|
||||
TailwindMarkdownRenderer.renderer
|
||||
(MarkdownCodec.withFrontmatter (\description body -> { description = description, body = body })
|
||||
(Decode.field "description" Decode.string)
|
||||
TailwindMarkdownRenderer.renderer
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user