fix: name systems and keep the picker filter

This commit is contained in:
Abdessamad Derraz committed 2026-10-22 19:16:36 +02:00
1 parent 1c898ba389
commit de5b517579
4 files changed
+53 -13

No files matched your search

+6 -1
View File
@@ -6864,7 +6864,12 @@ def _generate(args: argparse.Namespace) -> None:
json.dumps(sitestarlight.sidebar(nav, present), indent=1) + "\n")
write_if_changed(str(generated / "lastmod.json"),
json.dumps(dict(sorted(lastmod.items())), indent=1) + "\n")
sitestarlight.picker_data(_REPO_ROOT / "install", public / "data" / "picker")
mfr_names = {mfr.lower().replace(" ", "-"): mfr for mfr in manufacturers}
titles = {}
for sys_id, (slug, console) in _system_page_map.items():
mfr = mfr_names.get(slug, "")
titles[sys_id] = console if console.startswith(mfr) else f"{mfr} {console}"
sitestarlight.picker_data(_REPO_ROOT / "install", public / "data" / "picker", titles)
total_pages = len(present)
print(f"\nGenerated {total_pages} pages in {args.docs_dir}/")
if stale:
+4 -2
View File
@@ -494,9 +494,10 @@ def _links(items: list[dict]) -> Iterator[dict]:
# The picker's data
def picker_data(install: Path, out: Path) -> int:
def picker_data(install: Path, out: Path, titles: dict[str, str]) -> int:
"""Each manifest, compacted to what the file picker reads: per file its
destination, size and systems, the systems install.py --system accepts.
`titles` names a system id the way its system page does.
"""
out.mkdir(parents=True, exist_ok=True)
index = []
@@ -512,7 +513,8 @@ def picker_data(install: Path, out: Path) -> int:
"name": data.get("display_name", data["platform"]),
"folder": (data.get("detect") or [{}])[0].get("bios_path", ""),
"generated": data.get("generated", ""),
"systems": [{"id": s, "native": names.get(s, [])} for s in systems],
"systems": [{"id": s, "title": titles.get(s, ""), "native": names.get(s, [])}
for s in systems],
"other": any(not f.get("systems") for f in data["files"]),
"files": [[f["dest"], f.get("size", 0), [position[s] for s in f.get("systems") or []]]
for f in sorted(data["files"], key=lambda f: f["dest"])],