yesod-static-1.6.1.0: Static file serving subsite for Yesod Web Framework.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Yesod.EmbeddedStatic.Css.AbsoluteUrl

Contents

- Absolute urls

Description

Manipulate CSS urls.

- Make relative urls absolute (useful when combining assets)

Synopsis

- absoluteUrls :: FilePath -> Generator
- absoluteUrlsAt :: Location -> FilePath -> Generator
- absoluteUrlsWith :: Location -> FilePath -> Maybe (CssGeneration -> IO ByteString) -> Generator
- absCssUrlsFileProd :: FilePath -> FilePath -> IO ByteString
- absCssUrlsProd :: FilePath -> Text -> Text

# Absolute urls

absoluteUrls :: FilePath -> Generator #

Equivalent to passing the same string twice to `absoluteUrlsAt`.

absoluteUrlsAt :: Location -> FilePath -> Generator #

Equivalent to passing `return` to `absoluteUrlsWith`.

absoluteUrlsWith #

Arguments

:: Location | The location the CSS file should appear in the static subsite
-> FilePath | Path to the CSS file.
-> Maybe (CssGeneration -> IO ByteString) | Another filter function run after this one (for example `return . yuiCSS . cssContent`) or other CSS filter that runs after this filter.
-> Generator |

Automatically make relative urls absolute

During development, leave CSS as is.

When CSS is organized into a directory structure, it will work properly for individual requests for each file. During production, we want to combine and minify CSS as much as possible. The combination process combines files from different directories, messing up relative urls. This pre-processor makes relative urls absolute

absCssUrlsFileProd #

Arguments

:: FilePath | Anchor relative urls to here
-> FilePath |
-> IO ByteString |

Anchors relative CSS image urls

absCssUrlsProd #

Arguments

:: FilePath | Anchor relative urls to here
-> Text |
-> Text |