Add method copy_static_files
This commit is contained in:
@@ -178,8 +178,7 @@ class DataSite:
|
||||
def writeHTML(self, theme:str, pageName :str, htmlExport :str):
|
||||
publicFolder = Path(PurePosixPath(self.user_folder).joinpath('public'))
|
||||
themesFolder = Path(PurePosixPath('app').joinpath('templates','themes', self.datas['config']['theme'],'static'))
|
||||
publicStaticFolder = Path(PurePosixPath(self.user_folder).joinpath('public', 'static'))
|
||||
|
||||
|
||||
if pageName == '/':
|
||||
pageIndex = publicFolder / 'index.html'
|
||||
pageIndex.write_text(htmlExport)
|
||||
@@ -188,8 +187,12 @@ class DataSite:
|
||||
pageFolder.mkdir(exist_ok=True)
|
||||
pageIndex = pageFolder / 'index.html'
|
||||
pageIndex.write_text(htmlExport)
|
||||
|
||||
def copy_static_files(self):
|
||||
themesStaticFolder = Path(PurePosixPath('app').joinpath('static','themes', self.datas['config']['theme'],'static'))
|
||||
publicStaticFolder = Path(PurePosixPath(self.user_folder).joinpath('public', 'static'))
|
||||
rmtree (publicStaticFolder, ignore_errors=True)
|
||||
copytree(themesFolder, publicStaticFolder)
|
||||
copytree(themesStaticFolder, publicStaticFolder)
|
||||
|
||||
|
||||
def publish(self, user:str, password:str, serverAddress:str, serverPort:int, folder:str):
|
||||
|
||||
Reference in New Issue
Block a user