add support for template specified in config, although i havent yet sorted relative paths so its not as good as it could be