fix: missing custom_dir setting crashes build

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
This commit is contained in:
Martin Donath
2025-12-21 16:02:57 +01:00
committed by GitHub
parent fb9e647c4b
commit 2e31b939b9
+5 -1
View File
@@ -121,7 +121,11 @@ def get_theme_dir() -> str:
def get_custom_theme_dir(config: dict) -> str | None:
"""Return the custom theme directory."""
path = os.path.dirname(os.path.abspath(__file__))
return os.path.join(path, config["theme"]["custom_dir"])
if config["theme"].get("custom_dir"):
return os.path.join(path, config["theme"].get("custom_dir"))
# Otherwise, return no path
return None
def _apply_defaults(config: dict, path: str) -> dict: