rib-0.7.0.0: Static site generator using Shake

Safe HaskellNone
LanguageHaskell2010

Rib.Route

Description

Type-safe routes

Synopsis

Documentation

class IsRoute (r :: Type -> Type) where Source #

A route is a GADT representing individual routes.

The GADT type parameter represents the data used to render that particular route.

Methods

routeFile :: MonadThrow m => r a -> m (Path Rel File) Source #

Return the filepath (relative ribInputDir) where the generated content for this route should be written.

routeUrl :: IsRoute r => r a -> Text Source #

The absolute URL to this route (relative to site root)

routeUrlRel :: IsRoute r => r a -> Text Source #

The relative URL to this route

writeRoute :: (IsRoute r, ToString s) => r a -> s -> Action () Source #

Write the content s to the file corresponding to the given route.