I'm looking for simple and easy way to add template or layouts functionality to a web site in servant. So when I have a few similar pages, I don't have to create a layout for each of them completely from scratch, I can create a master or layout page and then each page can inherit it and change the html layout appropriately for itself. Everyone is familiar with that.
How can I do that? Currently I have using below code,
type API =
"items" :> Get '[JSON] [MyData] :<|>
Raw
app :: Application
app = serve api server
api :: Proxy API
api = Proxy
server :: Server API
server =
getItems :<|>
serveDirectory "my_html"
startApp :: IO ()
startApp = run 3333 app
Note that I'd not like to use an approach where you have to desribe the html layout in Haskell code.