diff --git a/app/lib/gruntConfig.js b/app/lib/gruntConfig.js index 5385a5d6..9ea62422 100644 --- a/app/lib/gruntConfig.js +++ b/app/lib/gruntConfig.js @@ -189,6 +189,8 @@ module.exports = function(grunt, options, spec) { templates: { files: [ options.specFile, + path.dirname(options.specFile) + '/**/*.md', + options.appDir + '/views/**/*.hbs', options.appDir + '/views/**/*.hbs', options.appDir + '/helpers/**/*.js', options.appDir + '/lib/**/*.js' diff --git a/app/lib/loadYaml.js b/app/lib/loadYaml.js index 3bae679e..10b84d7c 100644 --- a/app/lib/loadYaml.js +++ b/app/lib/loadYaml.js @@ -1,7 +1,14 @@ const fs = require('fs') -const yaml = require('js-yaml') +const p = require('path'); +const yaml = require('js-yaml'); + module.exports = function (path) { + const extendedSchema = yaml.DEFAULT_SCHEMA.extend({ + explicit: [ + new yaml.Type('!file', { kind: 'scalar', construct: function (relPath) { console.log(relPath); return fs.readFileSync(p.join(p.dirname(path), relPath), "utf8") }}) + ] + }); const fileContent = fs.readFileSync(path, "utf8") - return yaml.load(fileContent) + return yaml.load(fileContent, { schema: extendedSchema, filename: path }) } \ No newline at end of file