From 9e206d7f5ea941d0a36f52b9bb3a1bf0593c9ea5 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Sat, 17 Jul 2021 15:39:28 +0200 Subject: [PATCH] Refer to Bedrock templates using its own directory --- core/tasks/templates.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/tasks/templates.js b/core/tasks/templates.js index aa516a1..3c3c32d 100644 --- a/core/tasks/templates.js +++ b/core/tasks/templates.js @@ -24,6 +24,8 @@ const MultipleBaseDirs = require('../templates/multi-basedirs'); config.pug.plugins = [MultipleBaseDirs()]; +const bedrockDir = path.join(__dirname, '../../'); + function getDefaultLocals() { const defaultLocals = locals.getDefaultLocals(); defaultLocals.docs = docs.discover(); @@ -42,7 +44,7 @@ module.exports = { const tasks = Object.keys(defaultLocals.components.byGroup).map(componentGroup => { return gulp.src([ - paths.core.templates.styleguide.componentGroup + path.join(bedrockDir, paths.core.templates.styleguide.componentGroup) ]) .pipe(data(function (file) { return Object.assign({}, getDefaultLocals(), { @@ -60,7 +62,7 @@ module.exports = { tasks.push( gulp.src([ - paths.core.templates.styleguide.index + path.join(bedrockDir, paths.core.templates.styleguide.index) ]) .pipe(data(function (file) { return Object.assign({}, getDefaultLocals(), { @@ -82,7 +84,9 @@ module.exports = { const defaultLocals = getDefaultLocals(); const tasks = defaultLocals.docs.allDocs.map(doc => { - return gulp.src(paths.core.templates.styleguide.doc) + return gulp.src( + path.join(bedrockDir, paths.core.templates.styleguide.doc) + ) .pipe(data(function (file) { return Object.assign({}, getDefaultLocals(), { doc,