small adjustments

This commit is contained in:
CrSjimo 2021-09-10 22:20:50 +08:00
parent 81fa904599
commit 33fd026148
1 changed files with 5 additions and 3 deletions

View File

@ -20,11 +20,13 @@ function formatWidgets(widgets) {
}
function hasColumn(widgets, position, config, page) {
const showToc = (config.toc === true || page.toc) && ['page', 'post'].includes(page.layout);
const showToc = (config.toc === true) && ['page', 'post'].includes(page.layout);
if (Array.isArray(widgets)) {
return typeof widgets.find(widget => {
if(widget.type === 'toc' && !showToc)return false;
return widget.position === position
if (widget.type === 'toc' && !showToc) {
return false;
}
return widget.position === position;
}) !== 'undefined';
}
return false;