Skip to content

Commit b0024b8

Browse files
authored
fix: repaire hexo-config() return value (#170)
hexo-config(item) will return empty string '' if item is set as 0 in _config.yml due to (0 || '') is '' in /lib/renderer.js:line 16 And some themes need the value 0 or errors would occurr
1 parent 560cf83 commit b0024b8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/renderer.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ function getProperty(obj, name) {
1313
let result = obj[key];
1414
const len = split.length;
1515

16-
if (!len) return result || '';
16+
if (!len) {
17+
if(result === 0) return result;
18+
return result || '';
19+
}
1720
if (typeof result !== 'object') return '';
1821

1922
for (let i = 0; i < len; i++) {

0 commit comments

Comments
 (0)