etienne-moqueur/src/Routes.hs
etienne 2d5e928689 Added rudimentary blog posts functionality
At the moment, it seems a little hacky: templates from Kit.Templates are
compiled as html in a _templates directory, so that Hakyll can use them.
It seems that I might have to compile twice at times, as templates may
not be cached when I want to apply them. Might have to sort this out, or
it is a happy hack..
2022-09-21 19:56:36 +02:00

16 lines
402 B
Haskell

module Routes
( Route(..)
, render
) where
import Data.Text ( pack )
import Text.Hamlet ( Render )
data Route = Home
| DefaultStylesheet
| Post String
render :: Render Route
render Home _ = "/"
render DefaultStylesheet _ = "/css/default.css"
render (Post postId) _ = "/posts/" <> pack postId