Skip to content

Commit

Permalink
Refer to Bedrock templates using its own directory
Browse files Browse the repository at this point in the history
  • Loading branch information
thusc committed Nov 27, 2021
1 parent 69fc3b2 commit 9fc0855
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/tasks/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -43,7 +45,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(), {
Expand All @@ -61,7 +63,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(), {
Expand All @@ -83,7 +85,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,
Expand Down

0 comments on commit 9fc0855

Please sign in to comment.