hakyll-3.0.0.2: A simple static site generator library.

Hakyll.Web.Util.String

Description

Miscellaneous string manipulation functions.

Synopsis

Documentation

trim :: String -> StringSource

Trim a string (drop spaces, tabs and newlines at both sides).

replaceAllSource

Arguments

:: String

Pattern

-> (String -> String)

Replacement (called on capture)

-> String

Source string

-> String

Result

A simple (but inefficient) regex replace funcion

splitAllSource

Arguments

:: String

Pattern

-> String

String to split

-> [String]

Result

A simple regex split function. The resulting list will contain no empty strings.

toUrl :: FilePath -> StringSource

Convert a filepath to an URL starting from the site root

Example:

 toUrl "foo/bar.html"

Result:

 "/foo/bar.html"

toSiteRoot :: String -> StringSource

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