add options to support set basePath and omit extension in template function name
make pattern configable