4 Commits
v2.9.0 ... main

Author SHA1 Message Date
895ac03590 fallback 2026-02-04 08:55:30 +01:00
cad6d88b22 import update 2026-02-04 08:54:19 +01:00
e06df9444d update theme color 2026-02-04 08:53:49 +01:00
9d5ce13e14 version bump 2026-02-04 08:47:29 +01:00
5 changed files with 8 additions and 9 deletions

View File

@@ -1 +1 @@
2.9.0 2.9.1

View File

@@ -12,7 +12,7 @@ except ModuleNotFoundError:
RICH = False RICH = False
SCRIPTDIR = os.path.dirname(os.path.realpath(__file__)).removesuffix(__package__) SCRIPTDIR = os.path.dirname(os.path.realpath(__file__)).removesuffix(__package__ if __package__ else "")
DEFAULT_THEME_PATH = os.path.join(SCRIPTDIR, "templates", "default.css") DEFAULT_THEME_PATH = os.path.join(SCRIPTDIR, "templates", "default.css")
DEFAULT_AUTHOR = "Author" DEFAULT_AUTHOR = "Author"

View File

@@ -20,7 +20,7 @@ from modules.argumentparser import Args
from modules.datatypes.metadata import Metadata, ImageMetadata, SubfolderMetadata from modules.datatypes.metadata import Metadata, ImageMetadata, SubfolderMetadata
# Constants for file paths and exclusions # Constants for file paths and exclusions
SCRIPTDIR = os.path.dirname(os.path.realpath(__file__)).removesuffix(__package__) SCRIPTDIR = os.path.dirname(os.path.realpath(__file__)).removesuffix(__package__ if __package__ else "")
FAVICON_PATH = ".static/favicon.ico" FAVICON_PATH = ".static/favicon.ico"
GLOBAL_CSS_PATH = ".static/global.css" GLOBAL_CSS_PATH = ".static/global.css"
EXCLUDES = ["index.html", "manifest.json", "robots.txt"] EXCLUDES = ["index.html", "manifest.json", "robots.txt"]

View File

@@ -18,10 +18,10 @@ import gzip
import shutil import shutil
import logging import logging
from datetime import datetime from datetime import datetime
from pythonjsonlogger import jsonlogger from pythonjsonlogger import json as jsonlogger
# Constants for file paths and exclusions # Constants for file paths and exclusions
SCRIPTDIR = os.path.dirname(os.path.realpath(__file__)).removesuffix(__package__) SCRIPTDIR = os.path.dirname(os.path.realpath(__file__)).removesuffix(__package__ if __package__ else "")
LOG_DIR = os.path.join(SCRIPTDIR, "logs") LOG_DIR = os.path.join(SCRIPTDIR, "logs")
LATEST_LOG_FILE = os.path.join(LOG_DIR, "latest.jsonl") LATEST_LOG_FILE = os.path.join(LOG_DIR, "latest.jsonl")

View File

@@ -15,10 +15,10 @@ except ImportError:
from modules.logger import logger from modules.logger import logger
from modules.argumentparser import Args from modules.argumentparser import Args
from modules.css_color import extract_theme_color, extract_colorscheme from modules.css_color import extract_colorscheme
# Define constants for static files directory and icon sizes # Define constants for static files directory and icon sizes
SCRIPTDIR = os.path.dirname(os.path.realpath(__file__)).removesuffix(__package__) SCRIPTDIR = os.path.dirname(os.path.realpath(__file__)).removesuffix(__package__ if __package__ else "")
STATIC_FILES_DIR = os.path.join(SCRIPTDIR, "files") STATIC_FILES_DIR = os.path.join(SCRIPTDIR, "files")
ICON_SIZES = ["36x36", "48x48", "72x72", "96x96", "144x144", "192x192", "512x512"] ICON_SIZES = ["36x36", "48x48", "72x72", "96x96", "144x144", "192x192", "512x512"]
@@ -148,7 +148,7 @@ def render_manifest_json(_args: Args, icon_list: list[Icon], colors: dict[str, s
short_name=_args.site_title, short_name=_args.site_title,
icons=icon_list, icons=icon_list,
background_color=colors["bcolor1"], background_color=colors["bcolor1"],
theme_color=colors["theme_color"], theme_color=colors["color1"],
) )
with open(os.path.join(_args.root_directory, ".static", "manifest.webmanifest"), "w", encoding="utf-8") as f: with open(os.path.join(_args.root_directory, ".static", "manifest.webmanifest"), "w", encoding="utf-8") as f:
logger.info("rendering manifest.webmanifest", extra={"path": os.path.join(_args.root_directory, ".static", "manifest.webmanifest")}) logger.info("rendering manifest.webmanifest", extra={"path": os.path.join(_args.root_directory, ".static", "manifest.webmanifest")})
@@ -262,5 +262,4 @@ def webmanifest(_args: Args) -> None:
return return
colorscheme = extract_colorscheme(os.path.join(_args.root_directory, ".static", "theme.css")) colorscheme = extract_colorscheme(os.path.join(_args.root_directory, ".static", "theme.css"))
colorscheme["theme_color"] = extract_theme_color(os.path.join(_args.root_directory, ".static", "theme.css"))
render_manifest_json(_args, icon_list, colorscheme) render_manifest_json(_args, icon_list, colorscheme)