From 52a9d3b67c5375a1d5f4cb558e5e359e9fb9e9f6 Mon Sep 17 00:00:00 2001 From: Meekdai Date: Wed, 22 May 2024 09:18:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A6=96=E9=A1=B5script?= =?UTF-8?q?=E5=92=8Cstyle=E8=87=AA=E5=AE=9A=E4=B9=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 通过indexScript和indexStyle来配置 --- Gmeek.py | 2 +- templates/base.html | 1 - templates/plist.html | 2 ++ templates/post.html | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Gmeek.py b/Gmeek.py index ee781e6..a9e75e4 100644 --- a/Gmeek.py +++ b/Gmeek.py @@ -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('{}') diff --git a/templates/base.html b/templates/base.html index eb9b42d..c08a19b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -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"); {% block script %}{% endblock %} -{{ blogBase['script'] }} diff --git a/templates/plist.html b/templates/plist.html index d607273..5847de0 100644 --- a/templates/plist.html +++ b/templates/plist.html @@ -34,6 +34,7 @@ .LabelTime{display:none;} } +{{ 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 %} +{{ blogBase['indexScript'] }} {% endblock %} diff --git a/templates/post.html b/templates/post.html index 6bd90d2..6676904 100644 --- a/templates/post.html +++ b/templates/post.html @@ -110,5 +110,5 @@ function iFrameLoading(){ } } - +{{ blogBase['script'] }} {% endblock %}