diff --git a/layout/_partial/scripts/index.ejs b/layout/_partial/scripts/index.ejs index baccae160..29b8a5043 100644 --- a/layout/_partial/scripts/index.ejs +++ b/layout/_partial/scripts/index.ejs @@ -66,9 +66,9 @@ <% if (theme.comments.service && theme.comments.service.length > 0) { - try { - partial('../../_plugins/comments/' + theme.comments.service + '/script') - } catch (e) { + try { %> + <%- partial('../../_plugins/comments/' + theme.comments.service + '/script') %> + <% } catch (e) { // error friendly console.log(` =============================================================================== diff --git a/layout/_plugins/_page_plugins/index.ejs b/layout/_plugins/_page_plugins/index.ejs index 4700bacf1..d852895c7 100644 --- a/layout/_plugins/_page_plugins/index.ejs +++ b/layout/_plugins/_page_plugins/index.ejs @@ -1,7 +1,27 @@ -<%_(page.plugins||[]).forEach(function(item){ _%> - <%_if (typeof item == "string") { _%> - <%- partial( item + "/index") %> - <%_}else if(typeof item == "object"){ _%> - <%- partial( Object.keys(item)[0] + "/index", { pagePlugin:item }) %> - <%_} _%> -<%_ }) _%> +<%_ +(page.plugins||[]).forEach(function(item){ + try { + if (typeof item == "string") { _%> + <%- partial( item + "/index") %> +<%_ }else if(typeof item == "object"){ _%> + <%- partial( Object.keys(item)[0] + "/index", { pagePlugin:item }) %> +<%_ } + } catch (error) { + // error friendly + console.log(` +=============================================================================== + 没有找到页面插件:${item} + 请检查是否存在该插件,或者检查插件名称是否正确:${item} + 出问题的页面:${page.path} + see: https://volantis.js.org/v5/page-settings/#页面插件-page-plugins +================================================================================ + There is no page plugin: ${item} + Please check if the plugin exists, or check the plugin name is correct: ${item} + The page that has problem: ${page.path} + see: https://volantis.js.org/v5/page-settings/#页面插件-page-plugins +=================================================================================`); + } + +}) + +_%>