-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A simple static site generator library. -- -- A simple static site generator library , mainly aimed at creating -- blogs. @package hakyll @version 0.2 module Text.Hakyll.Util -- | Convert a relative filepath to a filepath in the destination (_site). toDestination :: FilePath -> FilePath -- | Convert a relative filepath to a filepath in the cache (_cache). toCache :: FilePath -> FilePath -- | Get the url for a given page. toURL :: FilePath -> FilePath -- | Given a path to a file, try to make the path writable by making all -- directories on the path. makeDirectories :: FilePath -> IO () -- | Get all contents of a directory. Note that files starting with a dot -- (.) will be ignored. getRecursiveContents :: FilePath -> IO [FilePath] -- | Trim a string (drop spaces and tabs at both sides). trim :: String -> String -- | Split a list at a certain element. split :: (Eq a) => a -> [a] -> [[a]] -- | Check is a cache file is still valid. isCacheValid :: FilePath -> [FilePath] -> IO Bool module Text.Hakyll.Renderable -- | A class for datatypes that can be rendered to pages. class Renderable a toContext :: (Renderable a) => a -> IO Context getDependencies :: (Renderable a) => a -> [FilePath] getURL :: (Renderable a) => a -> FilePath module Text.Hakyll.Page -- | A Page is basically key-value mapping. Certain keys have special -- meanings, like for example url, body and title. data Page -- | Create a Page from a key-value mapping. fromContext :: (Map ByteString ByteString) -> Page -- | Get the body for a certain page. When not defined, the body will be -- empty. getBody :: Page -> ByteString -- | Read a page from a file. Metadata is supported, and if the filename -- has a .markdown extension, it will be rendered using pandoc. Note that -- pages are not templates, so they should not contain $identifiers. readPage :: FilePath -> IO Page -- | Write a page to the site destination. writePage :: Page -> IO () instance Renderable Page module Text.Hakyll.Renderables -- | A custom page. data CustomPage -- | Create a custom page. createCustomPage :: String -> [FilePath] -> [(String, Either String (IO ByteString))] -> CustomPage -- | PagePath is a class that wraps a FilePath. This is used to render -- Pages without reading them first through use of caching. data PagePath -- | Create a PagePath from a FilePath. createPagePath :: FilePath -> PagePath instance Renderable PagePath instance Renderable CustomPage module Text.Hakyll.Render -- | Execute an IO action only when the cache is invalid. depends :: FilePath -> [FilePath] -> IO () -> IO () -- | Render to a Page. render :: (Renderable a) => FilePath -> a -> IO Page -- | Render each renderable with the given template, then concatenate the -- result. renderAndConcat :: (Renderable a) => FilePath -> [a] -> IO ByteString -- | Chain a render action for a page with a number of templates. This will -- also write the result to the site destination. This is the preferred -- way to do general rendering. renderChain :: (Renderable a) => [FilePath] -> a -> IO () -- | Mark a certain file as static, so it will just be copied when the site -- is generated. static :: FilePath -> IO () -- | Mark a whole directory as static. staticDirectory :: FilePath -> IO ()