add recursive template support

Add support for recursive templates using front matter