diff --git a/scripts/generators/notebooks.js b/scripts/generators/notebooks.js index f5fa101..989fb9e 100644 --- a/scripts/generators/notebooks.js +++ b/scripts/generators/notebooks.js @@ -30,7 +30,7 @@ function paginationWithEmpty(base, posts, options={}) { hexo.extend.generator.register('notebooks', function (locals) { const { site_tree, notebooks } = hexo.theme.config - if (notebooks.tree.length === undefined) { + if (!notebooks?.tree || Object.keys(notebooks.tree).length === 0) { return [] }