From 600898f139877748f4b79df0201246c9f0ad4c0b Mon Sep 17 00:00:00 2001 From: Meekdai Date: Mon, 1 Jul 2024 22:12:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9static=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=8B=B7=E8=B4=9D=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gmeek.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Gmeek.py b/Gmeek.py index 80ed285..5a8b0fd 100644 --- a/Gmeek.py +++ b/Gmeek.py @@ -79,6 +79,20 @@ class GMEEK(): else: print("static not exist") + if os.path.exists(self.static_dir): + for item in os.listdir(self.static_dir): + src = os.path.join(self.static_dir, item) + dst = os.path.join(self.root_dir, item) + if os.path.isfile(src): + shutil.copy(src, dst) + print(f"Copied {item} to docs") + elif os.path.isdir(src): + shutil.copytree(src, dst) + print(f"Copied directory {item} to docs") + else: + print("static does not exist") + + 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} config=json.loads(open('config.json', 'r', encoding='utf-8').read())