hakyll-1.1: A simple static site generator library.

Text.Hakyll.File

Description

A module containing various function for manipulating and examinating files and directories.

Synopsis

Documentation

toDestination :: FilePath -> FilePathSource

Convert a relative filepath to a filepath in the destination (_site).

toURL :: FilePath -> FilePathSource

Get the url for a given page.

toRoot :: FilePath -> FilePathSource

Get the relative url to the site root, for a given (absolute) url

removeSpaces :: FilePath -> FilePathSource

Swaps spaces for -.

makeDirectories :: FilePath -> Hakyll ()Source

Given a path to a file, try to make the path writable by making all directories on the path.

getRecursiveContents :: FilePath -> Hakyll [FilePath]Source

Get all contents of a directory. Note that files starting with a dot (.) will be ignored.

havingExtension :: String -> [FilePath] -> [FilePath]Source

A filter that takes all file names with a given extension. Prefix the extension with a dot:

 havingExtension ".markdown" [ "index.markdown"
                             , "style.css"
                             ] == ["index.markdown"]

isCacheValidSource

Arguments

:: FilePath

The cached file.

-> [FilePath]

Dependencies of the cached file.

-> Hakyll Bool 

Check if a cache file is still valid.

directory :: (FilePath -> Hakyll ()) -> FilePath -> Hakyll ()Source

Perform a Hakyll action on every file in a given directory.