Skip to content

Commit

Permalink
repaire hexo-config()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kusurin committed Nov 28, 2023
1 parent 560cf83 commit 5a5c604
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/renderer.js
Expand Up @@ -13,7 +13,10 @@ function getProperty(obj, name) {
let result = obj[key];
const len = split.length;

if (!len) return result || '';
if (!len) {
if(result === 0) return result;
return result || '';
}
if (typeof result !== 'object') return '';

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

0 comments on commit 5a5c604

Please sign in to comment.