diff --git a/Gmeek.py b/Gmeek.py index f72f06a..27f4493 100644 --- a/Gmeek.py +++ b/Gmeek.py @@ -88,7 +88,7 @@ class GMEEK(): def defaultConfig(self): - dconfig={"singlePage":[],"startSite":"","filingNum":"","onePageListNum":15,"commentLabelColor":"#006b75","yearColorList":["#bc4c00", "#0969da", "#1f883d", "#A333D0"],"i18n":"CN","themeMode":"manual","dayTheme":"light","nightTheme":"dark","urlMode":"pinyin","script":"","style":"","indexScript":"","indexStyle":"","bottomText":"","showPostSource":1,"iconList":{},"UTC":+8,"rssSplit":"sentence","exlink":{},"needComment":1} + dconfig={"singlePage":[],"startSite":"","filingNum":"","onePageListNum":15,"commentLabelColor":"#006b75","yearColorList":["#bc4c00", "#0969da", "#1f883d", "#A333D0"],"i18n":"CN","themeMode":"manual","dayTheme":"light","nightTheme":"dark","urlMode":"pinyin","script":"","style":"","indexScript":"","indexStyle":"","bottomText":"","showPostSource":1,"iconList":{},"UTC":+8,"rssSplit":"sentence","exlink":{},"needComment":1,"allHead":""} config=json.loads(open('config.json', 'r', encoding='utf-8').read()) self.blogBase={**dconfig,**config}.copy() self.blogBase["postListJson"]=json.loads('{}') diff --git a/plugins/GmeekBSZ.js b/plugins/GmeekBSZ.js index 0a33ec1..0cebe23 100644 --- a/plugins/GmeekBSZ.js +++ b/plugins/GmeekBSZ.js @@ -1,25 +1,7 @@ -function loadResource(type, attributes, callback) { - var element; - if (type === 'script') { - element = document.createElement('script'); - element.src = attributes.src; - element.onload = callback; - } else if (type === 'link') { - element = document.createElement('link'); - element.rel = attributes.rel; - element.href = attributes.href; - } else if (type === 'style') { - element = document.createElement('style'); - element.rel = 'stylesheet'; - element.appendChild(document.createTextNode(attributes.css)); - } - document.head.appendChild(element); -} - function createBSZ() { var postBody = document.getElementById('postBody'); if (postBody){ - postBody.insertAdjacentHTML('afterend','
'); + postBody.insertAdjacentHTML('afterend',''); } var runday = document.getElementById('runday'); runday.insertAdjacentHTML('afterend', ''); @@ -27,6 +9,8 @@ function createBSZ() { document.addEventListener("DOMContentLoaded", function() { createBSZ(); - loadResource('script', { src: '//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js' }); + var element = document.createElement('script'); + element.src = '//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js'; + document.head.appendChild(element); console.log("\n %c GmeekBSZ Plugins https://github.com/Meekdai/Gmeek \n","padding:5px 0;background:#bc4c00;color:#fff"); }); diff --git a/templates/base.html b/templates/base.html index 7d8fabe..bbc01b1 100644 --- a/templates/base.html +++ b/templates/base.html @@ -5,6 +5,7 @@ {{ blogBase['primerCSS'] }} + {{ blogBase['allHead'] }} {%- if blogBase['themeMode']=='manual' -%}