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 ctx where
- class Disembodied ctx a where
- writeSite :: forall layout ctx. Disembodied ctx layout => FilePath -> ctx -> SiteSpec ctx 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 ctx -> Site ctx -> Site ctx | Branch the site at a given point in generation. |
Class
class Disembodied ctx a where Source #
Type class induction for building the site out of a specification
type SiteSpec ctx 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" ])
buildSite :: SiteSpec ctx a -> Site ctx Source #
Construct the site structure out of the associated API
Instances
Disembodied ctx (View m a) Source # | |
Disembodied ctx (f (HTML ': ([] :: [Type])) (Html m a)) Source # | |
(Disembodied ctx x, Disembodied ctx y) => Disembodied ctx (x :<|> y) Source # | |
Disembodied ctx sub => Disembodied ctx (QueryFlag sym :> sub) Source # | |
Disembodied ctx sub => Disembodied ctx (QueryParams sym x :> sub) Source # | |
Defined in Shpadoinkle.Disembodied | |
Disembodied ctx sub => Disembodied ctx (QueryParam' ms sym x :> sub) Source # | |
Defined in Shpadoinkle.Disembodied | |
Disembodied ctx sub => Disembodied ctx (QueryParam sym x :> sub) Source # | |
Defined in Shpadoinkle.Disembodied | |
(Disembodied ctx sub, FromHttpApiData x, ToHttpApiData x, Bounded x, Enum x) => Disembodied ctx (Capture sym x :> sub) Source # | |
(Disembodied ctx sub, KnownSymbol path) => Disembodied ctx (path :> sub) Source # | |