Safe Haskell | None |
---|---|
Language | Haskell2010 |
Type-safe routes for static sites.
Defining routes
class IsRoute (r :: Type -> Type) where Source #
A route is a GADT which represents the individual routes in a static site.
r
represents the data used to render that particular route.
routeFile :: MonadThrow m => r a -> m FilePath Source #
Return the filepath (relative to ribInputDir
) where the
generated content for this route should be written.
Rendering routes
routeUrlRel :: IsRoute r => r a -> Text Source #
The relative URL to this route
Writing routes
writeRoute :: (IsRoute r, ToString s) => r a -> s -> Action () Source #
Write the content s
to the file corresponding to the given route.
This is similar to writeFileCached
, but takes a route instead of
a filepath as its argument.