Added the ability to use a custom favicon.

main
Josh Washburne 2022-10-17 14:29:07 +00:00 committed by Thomas Sileo
parent f50a233ce9
commit 647add2bab
1 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import asyncio
import io
import shutil
import tarfile
from contextlib import contextmanager
from pathlib import Path
@ -45,7 +46,12 @@ def compile_scss(ctx, watch=False):
# type: (Context, bool) -> None
from app.utils.favicon import build_favicon
favicon_file = Path("data/favicon.ico")
if not favicon_file.exists():
build_favicon()
else:
shutil.copy2(favicon_file, "app/static/favicon.ico")
theme_file = Path("data/_theme.scss")
if not theme_file.exists():
theme_file.write_text("// override vars for theming here")