Safe Haskell | None |
---|---|
Language | Haskell2010 |
Static sites are the opposite of headless applications, they are disembodied. Shpadoinkle Disembodied is a static site generator for Shpadoinkle applications.
Synopsis
- data Site where
- class Disembodied a where
- writeSite :: forall layout. Disembodied layout => FilePath -> SiteSpec layout -> IO ()
- writeSiteMap :: forall layout. Disembodied layout => String -> FilePath -> SiteSpec layout -> IO ()
Site Reification
The reification of a static site based on Servant routes.
Site takes a context ctx
which is universal for the static site.
This is useful for storing commonly used valus like the site name,
site url, copyright date, ect.
SPath | A path segment in the URI |
SIndex | Html to be rendered as |
SCapture | Capture is the one Servant combinator that can be meaningful in static site generation, and only if we can generate all possible instances. |
| |
SChoice :: Site -> Site -> Site | Branch the site at a given point in generation. |
Class
class Disembodied a where Source #
Type class induction for building the site out of a specification
type SiteSpec a :: Type Source #
A type family to represent the relationship between a Servant API
and the Html
views to render.
type SPA m = "about" :> Html m () :<|> Html m () site :: SiteSpec () (SPA m) site = const (h1_ [ text "about" ]) :<|> const (h1_ [ text "home" ])
Instances
Disembodied (f (HTML ': ([] :: [Type])) (Html m a)) Source # | |
Disembodied (View m a) Source # | |
(Disembodied x, Disembodied y) => Disembodied (x :<|> y) Source # | |
Disembodied sub => Disembodied (QueryParam sym x :> sub) Source # | |
Defined in Shpadoinkle.Disembodied | |
Disembodied sub => Disembodied (QueryParam' ms sym x :> sub) Source # | |
Defined in Shpadoinkle.Disembodied | |
Disembodied sub => Disembodied (QueryParams sym x :> sub) Source # | |
Defined in Shpadoinkle.Disembodied | |
Disembodied sub => Disembodied (QueryFlag sym :> sub) Source # | |
(Disembodied sub, FromHttpApiData x, ToHttpApiData x, Bounded x, Enum x) => Disembodied (Capture sym x :> sub) Source # | |
(Disembodied sub, KnownSymbol path) => Disembodied (path :> sub) Source # | |
Write Files
:: Disembodied layout | |
=> FilePath | Out path |
-> SiteSpec layout | Specification for the pages of the site relative to a Servant API. |
-> IO () |
Actually write the site to disk. Branches are written in parallel.
:: Disembodied layout | |
=> String | Base url |
-> FilePath | Out path |
-> SiteSpec layout | Specification for the pages of the site relative to a Servant API. |
-> IO () |
Generate a sitemap.xml