mathiassm
Safe HaskellTrustworthy
LanguageGHC2024

MathiasSM.CleanURL

Description

Clean URLs: routing and the stripping of the index.html suffix

Synopsis

Documentation

outputPath :: FilePath -> FilePath Source #

The output file for a public path: `contact` becomes `contactindex.html`, while a path with an extension (like `/404.html`) is kept as is.

pathRoute :: Metadata -> Routes Source #

Route from the `path:` front matter, laid out by outputPath

cleanIndex :: String -> String Source #

Strips a URL of its index.html suffix

cleanIndexHtmls :: Item String -> Compiler (Item String) Source #

Cleans all instances of /index, that might not be a recognized as a URL