From ee302041c8c87f272d054e2bb9dc8abe137a3ec0 Mon Sep 17 00:00:00 2001 From: Aadyaa Maddi Date: Sun, 13 Jan 2019 21:20:19 +0530 Subject: [PATCH] Improve the default `site.json` settings generated during init (#525) --- src/Site.js | 8 +++++++- test/unit/utils/data.js | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Site.js b/src/Site.js index 2445b01594..9460f53082 100644 --- a/src/Site.js +++ b/src/Site.js @@ -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'; @@ -57,6 +58,8 @@ const SITE_CONFIG_DEFAULT = { '_site/*', 'site.json', '*.md', + '*.mbd', + '.git/*', ], pages: [ { @@ -66,6 +69,9 @@ const SITE_CONFIG_DEFAULT = { { glob: '**/index.md', }, + { + glob: '**/*.+(md|mbd)', + }, ], deploy: { message: 'Site Update.', @@ -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, diff --git a/test/unit/utils/data.js b/test/unit/utils/data.js index 82c2dad8bb..76728df600 100644 --- a/test/unit/utils/data.js +++ b/test/unit/utils/data.js @@ -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' @@ -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'