mirror of
https://github.com/vinta/awesome-python.git
synced 2026-11-24 00:32:21 +00:00
fix: order category page JSON-LD ItemList to match rendered rows
Category pages' JSON-LD ItemList listed entries in download order while the table renders them in README (editorial) order, so structured-data positions didn't match the visible rows. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
5c4607dd0f
commit
f0ebe92155
2 changed files with 35 additions and 1 deletions
|
|
@ -755,8 +755,9 @@ def build(repo_root: Path) -> None:
|
|||
if parent_category:
|
||||
breadcrumbs.append((parent_category["name"], category_public_url(parent_category)))
|
||||
breadcrumbs.append((category["name"], category_url))
|
||||
page_entries = [entry for group in entry_groups for entry in group["entries"]] if entry_groups else entries
|
||||
category_json_ld = json.dumps(
|
||||
build_category_json_ld(category_title.removesuffix(" - Awesome Python"), category_url, category_description, entries, breadcrumbs),
|
||||
build_category_json_ld(category_title.removesuffix(" - Awesome Python"), category_url, category_description, page_entries, breadcrumbs),
|
||||
ensure_ascii=False,
|
||||
).replace("</", "<\\/")
|
||||
(page_dir / "index.html").write_text(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue