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..
16 lines
402 B
Haskell
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
|