Skip to content

Commit

Permalink
configuration possibility
Browse files Browse the repository at this point in the history
  • Loading branch information
juliancwirko committed May 2, 2021
1 parent 00ffd24 commit b0cc6c9
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 4 deletions.
63 changes: 62 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "harold-scripts",
"version": "0.2.1",
"version": "0.3.0",
"description": "Harold JS Scripts for Create Harold App",
"author": "Julian Ćwirko (julian.io)",
"engines": {
Expand Down Expand Up @@ -28,6 +28,7 @@
"chalk": "^3.0.0",
"chokidar": "^3.5.1",
"commander": "^7.1.0",
"cosmiconfig": "^7.0.0",
"cross-spawn": "^7.0.3",
"dateformat": "^4.5.1",
"deepmerge": "^4.2.2",
Expand Down
14 changes: 12 additions & 2 deletions scripts/build/constants.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
const { cosmiconfigSync } = require('cosmiconfig');
const explorerSync = cosmiconfigSync('harold');
const loaded = explorerSync.search(process.cwd());

module.exports = {
srcDirName: 'src',
layoutsDirName: 'blog-layouts',
layoutsDirName:
loaded && loaded.config && loaded.config.mdFilesLayoutsDirName
? loaded.config.mdFilesLayoutsDirName
: 'blog-layouts',
partialsDirName: 'partials',
postsDirName: 'posts',
postsDirName:
loaded && loaded.config && loaded.config.mdFilesDirName
? loaded.config.mdFilesDirName
: 'posts',
pagesDirName: 'pages',
assetsDirName: 'assets',
publicDirName: 'build',
Expand Down

0 comments on commit b0cc6c9

Please sign in to comment.