small adjustments
parent
81fa904599
commit
33fd026148
|
@ -20,11 +20,13 @@ function formatWidgets(widgets) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function hasColumn(widgets, position, config, page) {
|
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)) {
|
if (Array.isArray(widgets)) {
|
||||||
return typeof widgets.find(widget => {
|
return typeof widgets.find(widget => {
|
||||||
if(widget.type === 'toc' && !showToc)return false;
|
if (widget.type === 'toc' && !showToc) {
|
||||||
return widget.position === position
|
return false;
|
||||||
|
}
|
||||||
|
return widget.position === position;
|
||||||
}) !== 'undefined';
|
}) !== 'undefined';
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue