-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor content files import into its own plugin. #30
base: master
Are you sure you want to change the base?
Conversation
update readme for this refactor. add example config json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not convert everything from tabs to spaces?
updated the tabs issue. |
@@ -1,3 +1,4 @@ | |||
node_modules | |||
.DS_Store | |||
.nyc_output | |||
.vscode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add this to your ~/.gitignore
so you don't have to add it for every project.
helpersDir: 'templates/helpers' | ||
}, | ||
plugins: { | ||
files: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you discard all the changes in this file except for this part?
@@ -5,14 +5,22 @@ const cpFile = require('cp-file'); | |||
function copyImages (opts) { | |||
return new Promise((resolve, reject) => { | |||
// copy images | |||
glob(opts.contentsDir + '/**/*.{jpg,png,svg}', (err, files) => { | |||
glob(opts.files.contentsDir + '/**/*.{jpg,png,svg}', (err, files) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be opts.plugins.files
?
Also, it might make sense to have copyImages
be part of the files
plugin?
} | ||
}); | ||
currentDir[file.filename] = file; | ||
return Promise.all(plugins(opts.plugins, {})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think plugins()
return a single promise, so no need to do Promise.all
here?
refactor content files import into its own plugin.
update readme for this refactor.
add example config json.
closes #29