Skip to content

Commit ae98364

Browse files
authored
Merge pull request iissnan#1861 from julianxhokaxhiu/feature/issue-1860
Allow the user to override the whole configuration
2 parents b9ec0f6 + 092b616 commit ae98364

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

_config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# ---------------------------------------------------------------
2+
# Theme Core Configuration Settings
3+
# ---------------------------------------------------------------
4+
5+
# Set to true, if you want to fully override the default configuration.
6+
# Useful if you don't want to inherit the theme _config.yml configurations.
7+
override: false
8+
19
# ---------------------------------------------------------------
210
# Site Information Settings
311
# ---------------------------------------------------------------

scripts/merge-configs.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ var merge = require('./merge');
99
hexo.on('generateBefore', function () {
1010
if (hexo.locals.get) {
1111
var data = hexo.locals.get('data');
12-
data && data.next && merge(hexo.theme.config, data.next);
12+
if ( data && data.next ) {
13+
if ( data.next.override ) {
14+
hexo.theme.config = data.next;
15+
} else {
16+
merge(hexo.theme.config, data.next);
17+
}
18+
}
1319
}
1420
});

0 commit comments

Comments
 (0)