I have templates (*.tpl) in my-snap-app/snaplets/heist/templates (main.tpl, page1.tpl, page2.tpl, page3.tpl).
And here's my Main.hs:
import Snap.Http.Server
import Snap.Core
import Snap.Snaplet
import Snap.Snaplet.Heist
import Snap.Util.FileServe
import Snap.Util.GZip
import Heist.Interpreted
import Heist
--.......
data App = App { _heist :: Snaplet (Heist App) }
makeLenses ''App
instance HasHeist App where
heistLens = subSnaplet heist
How can I:
a) Make all the templates available in my web app? Meaning, I want to be able to access page1.tpl, page2.tpl, page3.tpl on
localhost://page1, localhost://page2, localhost://page3. Should I necessarily add a route for each page or can I add a route to make them accessible all at once?
2) main.tpl is a main template (layout). How can I make page[123] use main.tpl as a master layout template?