I have a bunch of static html files that share same header and footer. I would like to share this header and footer across all pages. For now i use the following routed but it is a bit ugly, and i have to take care of all special cases. Is there an easyway to dothis such as the php's include function?
(defroutes my-app
(GET "/"
(html-with-template
"main.header" "index.body" "main.footer" ))
(GET "/*.html"
(html-with-template
"main.header" (str (params :*) ".body") "main.footer" ))
(GET "/*/"
(html-with-template
(str (params :*) "/folder.header")
(str (params :*) "/index.body")
(str (params :*) "/folder.footer")))
(GET "/*"
(or (serve-file (params :*)) :next))
(ANY "*"
(page-not-found)))