Skip to content

Commit

Permalink
Improve the default site.json settings generated during init (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
amad-person authored and yamgent committed Jan 13, 2019
1 parent afb2746 commit ee30204
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/Site.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const Page = require('./Page');
const CLI_VERSION = require('../package.json').version;

const BOILERPLATE_FOLDER_NAME = '_markbind/boilerplates';
const CONFIG_FOLDER_NAME = '_markbind';
const HEADING_INDEXING_LEVEL_DEFAULT = 3;
const SITE_ASSET_FOLDER_NAME = 'asset';
const TEMP_FOLDER_NAME = '.temp';
Expand Down Expand Up @@ -57,6 +58,8 @@ const SITE_CONFIG_DEFAULT = {
'_site/*',
'site.json',
'*.md',
'*.mbd',
'.git/*',
],
pages: [
{
Expand All @@ -66,6 +69,9 @@ const SITE_CONFIG_DEFAULT = {
{
glob: '**/index.md',
},
{
glob: '**/*.+(md|mbd)',
},
],
deploy: {
message: 'Site Update.',
Expand Down Expand Up @@ -359,7 +365,7 @@ Site.prototype.collectAddressablePages = function () {
globPages.concat(walkSync(this.rootPath, {
directories: false,
globs: [addressableGlob.glob],
ignore: [BOILERPLATE_FOLDER_NAME],
ignore: [CONFIG_FOLDER_NAME],
}).map(globPath => ({
src: globPath,
searchable: addressableGlob.searchable,
Expand Down
7 changes: 6 additions & 1 deletion test/unit/utils/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ module.exports.SITE_JSON_DEFAULT = '{\n'
+ ' "_markbind/logs/*",\n'
+ ' "_site/*",\n'
+ ' "site.json",\n'
+ ' "*.md"\n'
+ ' "*.md",\n'
+ ' "*.mbd",\n'
+ ' ".git/*"\n'
+ ' ],\n'
+ ' "pages": [\n'
+ ' {\n'
Expand All @@ -58,6 +60,9 @@ module.exports.SITE_JSON_DEFAULT = '{\n'
+ ' },\n'
+ ' {\n'
+ ' "glob" : "**/index.md"\n'
+ ' },\n'
+ ' {\n'
+ ' "glob" : "**/*.+(md|mbd)"\n'
+ ' }\n'
+ ' ],\n'
+ ' "deploy": {\n'
Expand Down

0 comments on commit ee30204

Please sign in to comment.