As soon as you consider to reuse a part of a template, you must define the part as a snippet, not as a template. Templates are only for top-level, they return a html serialization. Snippets return trees.
One way to achieve your goal is to define your header and footer in a file (say "layout.html") and to use this file as a source for your template. From there there are two main alternatives:
* either you pass each component of the page as an argument, eg:
(deftemplate layout "layout.html" [title main]
[:#title] (content title)
[:#content] (substitute main))
(where main can be a tree)
* or your give it a single argument: the page to be decorated (the page itself being rendered by a snippet)
(deftemplate layout "layout.html" [page]
[:#title] (content (select page [:title]))
[:#content] (substitute (select page [:body])))
(you may have to also copy meta/script/style tags)