diff --git a/layout/_partials/footer/footer.pug b/layout/_partials/footer/footer.pug index e00adc3cfd21d2d9e96704540c179d3b59a24348..54cf94a85e97054ba6582488de7b3bc18b641377 100644 --- a/layout/_partials/footer/footer.pug +++ b/layout/_partials/footer/footer.pug @@ -1,9 +1,9 @@ - - var footer = theme.footer - var nowYear = new Date().getFullYear() - var startYear = copyright ? footer.copyright.since || nowYear : nowYear - var endYear = copyright ? footer.copyright.end || nowYear : nowYear - var fa_prefix = theme.fa_prefix || 'fa' + var footer = theme.footer; + var nowYear = new Date().getFullYear(); + var startYear = copyright ? footer.copyright.since || nowYear : nowYear; + var endYear = copyright ? footer.copyright.end || nowYear : nowYear; + var fa_prefix = theme.fa_prefix || 'fa'; - var footerCopyright = footer.copyright.enable - var footerBeian = footer.beian.enable diff --git a/layout/_partials/widgets/copyright.pug b/layout/_partials/widgets/copyright.pug index f19c8c27c47f29f3712aa98ff0f963dd5c199d74..9bd8ef1ebed0badd05311c2f2ccdb927dd7378bb 100644 --- a/layout/_partials/widgets/copyright.pug +++ b/layout/_partials/widgets/copyright.pug @@ -1,8 +1,8 @@ - - var themeCC = theme.creative_commons - var ccLicense = themeCC.license && themeCC.license.toLowerCase() - var ccLanguage = (themeCC.language && themeCC.language.toLowerCase()) || "en" - var ccURL = `https://creativecommons.org/licenses/${ccLicense}/4.0/deed.${ccLanguage}` + var themeCC = theme.creative_commons; + var ccLicense = themeCC.license && themeCC.license.toLowerCase(); + var ccLanguage = (themeCC.language && themeCC.language.toLowerCase()) || "en"; + var ccURL = `https://creativecommons.org/licenses/${ccLicense}/4.0/deed.${ccLanguage}`; div.post-copyright div.post-copyright-author diff --git a/layout/_third-party/comments/gitalk.pug b/layout/_third-party/comments/gitalk.pug index 68414b1a15b937d93e85e686f474d431b3abe624..20acd9be84edaca9f08465495187b0e847331f3c 100644 --- a/layout/_third-party/comments/gitalk.pug +++ b/layout/_third-party/comments/gitalk.pug @@ -1,9 +1,14 @@ - - var gitalk_js = "https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js" - var gitalk_md5 = "https://cdn.jsdelivr.net/npm/js-md5@latest/src/md5.min.js" + var gitalk_js = "https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js"; + var gitalk_md5 = "https://cdn.jsdelivr.net/npm/js-md5@latest/src/md5.min.js"; - if (theme.cdn.gitalk_js) gitalk_js = theme.cdn.gitalk_js - if (theme.cdn.gitalk_md5) gitalk_md5 = theme.cdn.gitalk_md5 + if (theme.cdn.gitalk_js) { + gitalk_js = theme.cdn.gitalk_js; + } + + if (theme.cdn.gitalk_md5) { + gitalk_md5 = theme.cdn.gitalk_md5; + } script(src=gitalk_js)&attributes(dataPjax) script(src=gitalk_md5)&attributes(dataPjax) diff --git a/layout/_third-party/comments/valine.pug b/layout/_third-party/comments/valine.pug index fcc655be90862e6d94b2b2606ce902f0f064c33c..42ed9be23f68712b0ed4fa9beeaefc7fcbf2e049 100644 --- a/layout/_third-party/comments/valine.pug +++ b/layout/_third-party/comments/valine.pug @@ -1,9 +1,14 @@ - - var leancloud_storage_js = "https://cdn.jsdelivr.net/npm/leancloud-storage@latest/dist/av-min.js" - var valine_js = "https://cdn.jsdelivr.net/npm/valine@latest/dist/Valine.min.js" + var leancloud_storage_js = "https://cdn.jsdelivr.net/npm/leancloud-storage@latest/dist/av-min.js"; + var valine_js = "https://cdn.jsdelivr.net/npm/valine@latest/dist/Valine.min.js"; - if (theme.cdn.leancloud_storage) leancloud_storage_js = theme.cdn.leancloud_storage - if (theme.cdn.valine) valine_js = theme.cdn.valine + if (theme.cdn.leancloud_storage) { + leancloud_storage_js = theme.cdn.leancloud_storage; + } + + if (theme.cdn.valine) { + valine_js = theme.cdn.valine; + } script(src=leancloud_storage_js) script(src=valine_js) diff --git a/layout/_third-party/pjax.pug b/layout/_third-party/pjax.pug index 2256df487e1e9b73d461b80ceb360e3e6aa1caf1..df7cd587c1d71468536a49e2062f0c99abd6c4b7 100644 --- a/layout/_third-party/pjax.pug +++ b/layout/_third-party/pjax.pug @@ -23,12 +23,15 @@ if (theme.pjax.elements) { pjaxArgs.elements.push(theme.pjax.elements); } + if (theme.pjax.selectors) { pjaxArgs.selectors.push(theme.pjax.selectors); } + if (theme.pjax.selectors) { pjaxArgs.switches = theme.pjax.selectors; } + if (theme.pjax.selectors) { pjaxArgs.switchesOptions = theme.pjax.selectors; } diff --git a/layout/_third-party/quicklink.pug b/layout/_third-party/quicklink.pug index 3a792e9e8e778ca7eb40e89b9ebe03c10ac839e2..40ffe68e4dc47d80f0e38029622bea9bacc26e8a 100644 --- a/layout/_third-party/quicklink.pug +++ b/layout/_third-party/quicklink.pug @@ -1,8 +1,11 @@ if theme.quicklink.enable - - var quicklink_js = "https://cdn.jsdelivr.net/npm/quicklink@1.0.1/dist/quicklink.umd.js" - if (theme.cdn.quicklink) quicklink_js = theme.cdn.quicklink - var loadQuicklink = false + var loadQuicklink = false; + var quicklink_js = "https://cdn.jsdelivr.net/npm/quicklink@1.0.1/dist/quicklink.umd.js"; + + if (theme.cdn.quicklink) { + quicklink_js = theme.cdn.quicklink; + } if is_home() && theme.quicklink.home - loadQuicklink = true diff --git a/layout/_third-party/search/algolia.pug b/layout/_third-party/search/algolia.pug index bcd7a90938eb8dc38a50b5c947eca0878029d09c..484383d30bf44695affc2522303ce9d0a87c1149 100644 --- a/layout/_third-party/search/algolia.pug +++ b/layout/_third-party/search/algolia.pug @@ -1,6 +1,9 @@ - - var instantsearch_js = "https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.js" - if (theme.cdn.instantsearch_js) instantsearch_js = theme.cdn.instantsearch_js + var instantsearch_js = "https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.js"; + + if (theme.cdn.instantsearch_js) { + instantsearch_js = theme.cdn.instantsearch_js; + } script(src=instantsearch_js defer)