Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 Source #
Equivalent to passing the same string twice to absoluteUrlsAt
.
absoluteUrlsAt :: Location -> FilePath -> Generator Source #
Equivalent to passing return
to absoluteUrlsWith
.
:: 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 |
-> 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
:: FilePath | Anchor relative urls to here |
-> FilePath | |
-> IO ByteString |
Anchors relative CSS image urls