mirror of
https://gitlab.com/octtspacc/staticoso
synced 2025-06-05 22:09:23 +02:00
First addition of experimental HTML site search; Update to themes build scripts
This commit is contained in:
@@ -1 +1,19 @@
|
||||
#!/bin/sh
|
||||
cd "$( dirname "$( realpath "$0" )" )"
|
||||
|
||||
cd ../Sources/Themes
|
||||
|
||||
for Theme in *
|
||||
do
|
||||
cd ../../
|
||||
mkdir -p ./Build/Demos/$Theme
|
||||
cd ./Build/Demos/$Theme
|
||||
mkdir -p ./Assets ./Templates ./Posts
|
||||
cp -r ../../Themes/$Theme ./.Source
|
||||
cp ./.Source/$Theme.html ./Templates/Default.html
|
||||
cp ./.Source/*.css ./Assets/
|
||||
cp ../../../Sources/Snippets/*.md ./Posts/
|
||||
python3 ../../../../App/Source/Build.py \
|
||||
--SiteName="$Theme"
|
||||
cd ../../../Sources/Themes
|
||||
done
|
||||
|
@@ -4,18 +4,18 @@ import shutil
|
||||
from pathlib import Path
|
||||
|
||||
def Main():
|
||||
for Theme in os.listdir("Sources/Themes"):
|
||||
Path(f"Build/Themes/{Theme}").mkdir(parents=True, exist_ok=True)
|
||||
for Theme in os.listdir('./Sources/Themes'):
|
||||
Path(f'./Build/Themes/{Theme}').mkdir(parents=True, exist_ok=True)
|
||||
try:
|
||||
shutil.copyfile(f"Sources/Themes/{Theme}/Style.css", f"Build/Themes/{Theme}/Style.css")
|
||||
shutil.copyfile(f'./Sources/Themes/{Theme}/{Theme}.css', f'./Build/Themes/{Theme}/{Theme}.css')
|
||||
except FileExistsError:
|
||||
pass
|
||||
with open(f"Sources/Snippets/Base.html", "r") as f:
|
||||
with open(f'./Sources/Snippets/Base.html', 'r') as f:
|
||||
Base = f.read()
|
||||
with open(f"Sources/Themes/{Theme}/Body.html", "r") as f:
|
||||
with open(f'./Sources/Themes/{Theme}/Body.html', 'r') as f:
|
||||
Body = f.read()
|
||||
with open(f"Build/Themes/{Theme}/{Theme}.html", "w+") as f:
|
||||
f.write(Base.replace("{{Body}}", Body))
|
||||
with open(f'./Build/Themes/{Theme}/{Theme}.html', 'w+') as f:
|
||||
f.write(Base.replace('{{Theme}}', Theme).replace('{{Body}}', Body))
|
||||
|
||||
if __name__ == "__main__":
|
||||
if __name__ == '__main__':
|
||||
Main()
|
||||
|
Reference in New Issue
Block a user