From fd62f0f497339cd4cc095b6805b6d0e810bf8a89 Mon Sep 17 00:00:00 2001 From: xscriptor Date: Mon, 28 Sep 2026 14:00:02 +0200 Subject: [PATCH] palettes: support subfolder and community palette paths load_palettes recurses into subfolders and the active palette fallback also resolves community/ so the community set generates themes like the flat palettes. --- CHANGELOG.md | 9 +++++++++ themesync/cli.py | 3 ++- themesync/core.py | 4 +++- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..4f411f0 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog + +All notable changes to the equisdots theme-sync engine are documented here. +Dates use YYYY-MM-DD. + +## [2026-09-28] + +### Fixed +- Palette loading recurses into subfolders (`rglob`) and the active palette fallback also looks under `community/`, so the community palettes shipped by the `equisdots/palettes` repo generate themes exactly like the flat ones. diff --git a/themesync/cli.py b/themesync/cli.py index 1075250..e5b49b8 100644 --- a/themesync/cli.py +++ b/themesync/cli.py @@ -34,7 +34,8 @@ def build_env(args) -> Env: if palette is None: # The active palette may be missing from the directory (e.g. deleted): # try loading its file directly; otherwise it stays empty. - palette = load_json(palettes_dir / (slug + ".json"), {}) or {} + palette = load_json(palettes_dir / (slug + ".json"), {}) or \ + load_json(palettes_dir / "community" / (slug + ".json"), {}) or {} return Env(home=home, palettes_dir=palettes_dir, settings_path=settings_path, slug=slug, palettes=palettes, palette=palette, dry_run=args.dry_run) diff --git a/themesync/core.py b/themesync/core.py index 6e4a4ec..69978f2 100644 --- a/themesync/core.py +++ b/themesync/core.py @@ -93,7 +93,9 @@ def load_palettes(palettes_dir: Path) -> list: schema.json = format contract): only files with palette data count. """ out = [] - for pf in sorted(Path(palettes_dir).glob("*.json")): + # rglob: palettes may live in subfolders (e.g. community/), which the panel + # lists through index.json "path" entries. + for pf in sorted(Path(palettes_dir).rglob("*.json")): if pf.name in METADATA_FILES: continue pal = load_json(pf)