添加首页script和style自定义功能

通过indexScript和indexStyle来配置
This commit is contained in:
Meekdai 2024-05-22 09:18:01 +08:00
parent 8131149b55
commit 52a9d3b67c
4 changed files with 4 additions and 3 deletions

View File

@ -72,7 +72,7 @@ class GMEEK():
os.mkdir(self.post_dir)
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":"","bottomText":"","showPostSource":1,"iconList":{},"UTC":+8,"rssSplit":"sentence","exlink":{}}
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":{}}
config=json.loads(open('config.json', 'r', encoding='utf-8').read())
self.blogBase={**dconfig,**config}.copy()
self.blogBase["postListJson"]=json.loads('{}')

View File

@ -60,6 +60,5 @@ if(themeSettings[theme]){changeTheme(...themeSettings[theme]);}
console.log("\n %c Gmeek {{ blogBase['GMEEK_VERSION'] }} https://github.com/Meekdai/Gmeek \n\n","padding:5px 0;background:#02d81d;color:#fff");
</script>
{% block script %}{% endblock %}
{{ blogBase['script'] }}
</html>

View File

@ -34,6 +34,7 @@
.LabelTime{display:none;}
}
</style>
{{ blogBase['indexStyle'] }}
{% endblock %}
{% block header %}
@ -140,4 +141,5 @@ document.getElementById("{{ key }}").setAttribute("d",value=IconList["{{ key }}"
document.getElementById("{{ blogBase['singeListJson'][num]['postTitle'] }}").setAttribute("d",value=IconList["{{ blogBase['singeListJson'][num]['labels'][0] }}"]);
{%- endfor %}
</script>
{{ blogBase['indexScript'] }}
{% endblock %}

View File

@ -110,5 +110,5 @@ function iFrameLoading(){
}
}
</script>
{{ blogBase['script'] }}
{% endblock %}