hakyll-4.9.7.0: A static website compiler library

Safe Haskell | None
Language | Haskell98

Hakyll.Web.Html.RelativizeUrls

Description

This module exposes a function which can relativize URL's on a webpage.

This means that one can deploy the resulting site on `http://example.com/`, but also on `http://example.com/some-folder/` without having to change anything (simply copy over the files).

To use it, you should use absolute URL's from the site root everywhere. For example, use

    <img src="/images/lolcat.png" alt="Funny zomgroflcopter" />

in a blogpost. When running this through the relativize URL's module, this will result in (suppose your blogpost is located at `/posts/foo.html`:

    <img src="../images/lolcat.png" alt="Funny zomgroflcopter" />

Synopsis

- relativizeUrls :: Item String -> Compiler (Item String)
- relativizeUrlsWith :: String -> String -> String

# Documentation

relativizeUrls :: Item String -> Compiler (Item String) #

Compiler form of `relativizeUrls` which automatically picks the right root path

relativizeUrlsWith #

Arguments

:: String | Path to the site root
-> String | HTML to relativize
-> String | Resulting HTML

Relativize URL's in HTML