sitepipe-0.1.0: A simple to understand static site generator

Safe HaskellNone
LanguageHaskell2010

SitePipe.Files

Contents

Synopsis

Loaders

resourceLoader :: (String -> IO String) -> [GlobPattern] -> SiteM [Value] Source #

Given a resource reader (see SitePipe.Readers) this function finds all files matching any of the provided list of fileglobs (according to srcGlob) and returns a list of loaded resources as Aeson Values.

Writers

writeWith :: ToJSON a => (a -> SiteM String) -> [a] -> SiteM () Source #

Write a list of resources using the given processing function from a resource to a string.

writeTemplate :: ToJSON a => FilePath -> [a] -> SiteM () Source #

Given a path to a mustache template file (relative to your source directory); this writes a list of resources to the output directory by applying each one to the template.

textWriter :: ToJSON a => [a] -> SiteM () Source #

Writes the content of the given resources without using a template.

Loader/Writers

copyFiles :: [GlobPattern] -> SiteM () Source #

Given a list of file or directory globs (see srcGlob) we copy matching files and directories as-is from the source directory to the output directory maintaining their relative filepath.

copyFilesWith :: (FilePath -> FilePath) -> [GlobPattern] -> SiteM () Source #

Runs copyFiles but using a filepath transforming function to determine the output filepath. The filepath transformation accepts and should return a relative path.