mirror of
https://github.com/ai-robots-txt/ai.robots.txt.git
synced 2025-04-12 05:57:45 +00:00
Sort the content case-insensitively before dumping to JSON
This commit is contained in:
parent
b1491d2694
commit
7bb5efd462
1 changed files with 3 additions and 1 deletions
|
@ -70,4 +70,6 @@ for section in soup.find_all("div", {"class": "agent-links-section"}):
|
||||||
}
|
}
|
||||||
|
|
||||||
print(f"Total: {len(existing_content)}")
|
print(f"Total: {len(existing_content)}")
|
||||||
Path("./robots.json").write_text(json.dumps(existing_content, indent=4, sort_keys=True))
|
sorted_keys = sorted(existing_content, key=lambda k: k.lower())
|
||||||
|
existing_content = {k: existing_content[k] for k in sorted_keys}
|
||||||
|
Path("./robots.json").write_text(json.dumps(existing_content, indent=4))
|
Loading…
Reference in a new issue