添加首页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) os.mkdir(self.post_dir)
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":"","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()) 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('{}')

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"); console.log("\n %c Gmeek {{ blogBase['GMEEK_VERSION'] }} https://github.com/Meekdai/Gmeek \n\n","padding:5px 0;background:#02d81d;color:#fff");
</script> </script>
{% block script %}{% endblock %} {% block script %}{% endblock %}
{{ blogBase['script'] }}
</html> </html>

View File

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

View File

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