添加allHead配置,用于自定义所有页面的head标签
This commit is contained in:
parent
1bb985b92e
commit
a23cfe26be
2
Gmeek.py
2
Gmeek.py
@ -88,7 +88,7 @@ class GMEEK():
|
|||||||
|
|
||||||
|
|
||||||
def defaultConfig(self):
|
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())
|
config=json.loads(open('config.json', 'r', encoding='utf-8').read())
|
||||||
self.blogBase={**dconfig,**config}.copy()
|
self.blogBase={**dconfig,**config}.copy()
|
||||||
self.blogBase["postListJson"]=json.loads('{}')
|
self.blogBase["postListJson"]=json.loads('{}')
|
||||||
|
|||||||
@ -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() {
|
function createBSZ() {
|
||||||
var postBody = document.getElementById('postBody');
|
var postBody = document.getElementById('postBody');
|
||||||
if (postBody){
|
if (postBody){
|
||||||
postBody.insertAdjacentHTML('afterend','<div id="busuanzi_container_page_pv" style="display:none;float:left;margin-top:8px;font-size:small;">本文浏览量 <span id="busuanzi_value_page_pv"></span>次</div>');
|
postBody.insertAdjacentHTML('afterend','<div id="busuanzi_container_page_pv" style="display:none;float:left;margin-top:8px;font-size:small;">本文浏览量<span id="busuanzi_value_page_pv"></span>次</div>');
|
||||||
}
|
}
|
||||||
var runday = document.getElementById('runday');
|
var runday = document.getElementById('runday');
|
||||||
runday.insertAdjacentHTML('afterend', '<div id="busuanzi_container_site_pv" style="display:none;">总浏览量<span id="busuanzi_value_site_pv"></span>次 • </div>');
|
runday.insertAdjacentHTML('afterend', '<div id="busuanzi_container_site_pv" style="display:none;">总浏览量<span id="busuanzi_value_site_pv"></span>次 • </div>');
|
||||||
@ -27,6 +9,8 @@ function createBSZ() {
|
|||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
createBSZ();
|
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");
|
console.log("\n %c GmeekBSZ Plugins https://github.com/Meekdai/Gmeek \n","padding:5px 0;background:#bc4c00;color:#fff");
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
{{ blogBase['primerCSS'] }}
|
{{ blogBase['primerCSS'] }}
|
||||||
|
{{ blogBase['allHead'] }}
|
||||||
<link rel="icon" href="{{ blogBase['faviconUrl'] }}">
|
<link rel="icon" href="{{ blogBase['faviconUrl'] }}">
|
||||||
{%- if blogBase['themeMode']=='manual' -%}
|
{%- if blogBase['themeMode']=='manual' -%}
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
<div id="footer1">Copyright © <span id="copyrightYear"></span> <a href="{{ blogBase['homeUrl'] }}">{{ blogBase['title'] }}</a></div>
|
<div id="footer1">Copyright © <span id="copyrightYear"></span> <a href="{{ blogBase['homeUrl'] }}">{{ blogBase['title'] }}</a></div>
|
||||||
<div id="footer2">
|
<div id="footer2">
|
||||||
{%- if blogBase['filingNum']!='' -%}
|
{%- if blogBase['filingNum']!='' -%}
|
||||||
<span id="filingNum"><a href="https://beian.miit.gov.cn/" target="_blank">{{ blogBase['filingNum'] }} • </a></span>
|
<span id="filingNum"><a href="https://beian.miit.gov.cn/" target="_blank">{{ blogBase['filingNum'] }}</a> • </span>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
<span id="runday"></span>Powered by <a href="https://meekdai.com/Gmeek.html" target="_blank">Gmeek</a>
|
<span id="runday"></span><span>Powered by <a href="https://meekdai.com/Gmeek.html" target="_blank">Gmeek</a></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user