Rename function.

This commit is contained in:
Dillon Kearns 2021-04-20 14:57:28 -07:00
parent 7f14f6171a
commit e1b4d90087
3 changed files with 7 additions and 6 deletions

View File

@ -24,7 +24,7 @@ blogPostsGlob =
|> Glob.ignore (Glob.literal "content/blog/")
|> Glob.capture Glob.wildcard
|> Glob.ignore (Glob.literal ".md")
|> Glob.toStaticHttp
|> Glob.toDataSource
allMetadata : DataSource.DataSource (List ( PagePath, ArticleMetadata ))

View File

@ -269,7 +269,7 @@ articlesRequest =
|> Glob.ignore (Glob.literal "content/blog/")
|> Glob.ignore Glob.wildcard
|> Glob.ignore (Glob.literal ".md")
|> Glob.toStaticHttp
|> Glob.toDataSource
|> DataSource.andThen
(\articleFilePaths ->
articleFilePaths

View File

@ -1,6 +1,7 @@
module Glob exposing
( Glob, atLeastOne, extractMatches, fullFilePath, literal, map, not, notOneOf, oneOf, recursiveWildcard, run, singleFile, succeed, toNonEmptyWithDefault, toPattern, toStaticHttp, wildcard, zeroOrMore
( Glob, atLeastOne, extractMatches, fullFilePath, literal, map, not, notOneOf, oneOf, recursiveWildcard, run, singleFile, succeed, toNonEmptyWithDefault, toPattern, wildcard, zeroOrMore
, capture, ignore
, toDataSource
)
{-|
@ -304,8 +305,8 @@ type alias RawGlob =
{-| -}
toStaticHttp : Glob a -> DataSource.DataSource (List a)
toStaticHttp glob =
toDataSource : Glob a -> DataSource.DataSource (List a)
toDataSource glob =
DataSource.Http.get (Secrets.succeed <| "glob://" ++ toPattern glob)
(OptimizedDecoder.map2 RawGlob
(OptimizedDecoder.string |> OptimizedDecoder.list |> OptimizedDecoder.field "captures")
@ -322,7 +323,7 @@ singleFile filePath =
succeed identity
|> ignore (literal filePath)
|> capture fullFilePath
|> toStaticHttp
|> toDataSource
|> DataSource.andThen
(\globResults ->
case globResults of