ema-0.10.0.0: Static site generator library with hot reload
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ema.Route.Url

Synopsis

Create URL from route

routeUrl :: HasCallStack => Prism' FilePath r -> r -> Text Source #

Like routeUrlWith but uses UrlDirect strategy

routeUrlWith :: HasCallStack => UrlStrategy -> Prism' FilePath r -> r -> Text Source #

Return the relative URL of the given route

Note: when using relative URLs it is imperative to set the `base` URL to your site's base URL or path (typically just /). Otherwise you must accordingly make these URLs absolute yourself.

data UrlStrategy Source #

How to produce URL paths from routes

Constructors

UrlPretty

Use pretty URLs. The route encoding "foobar.html" produces "foobar" as URL.

UrlDirect

Use filepaths as URLs. The route encoding "foobar.html" produces "foobar.html" as URL.

Instances

Instances details
FromJSON UrlStrategy Source # 
Instance details

Defined in Ema.Route.Url

Generic UrlStrategy Source # 
Instance details

Defined in Ema.Route.Url

Associated Types

type Rep UrlStrategy :: Type -> Type #

Show UrlStrategy Source # 
Instance details

Defined in Ema.Route.Url

Eq UrlStrategy Source # 
Instance details

Defined in Ema.Route.Url

Ord UrlStrategy Source # 
Instance details

Defined in Ema.Route.Url

type Rep UrlStrategy Source # 
Instance details

Defined in Ema.Route.Url

type Rep UrlStrategy = D1 ('MetaData "UrlStrategy" "Ema.Route.Url" "ema-0.10.0.0-IvDsUicoMaZ9ZiKA06zERq" 'False) (C1 ('MetaCons "UrlPretty" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UrlDirect" 'PrefixI 'False) (U1 :: Type -> Type))