From 921d47b4556200de4afd4a2bba4e22bb0578a773 Mon Sep 17 00:00:00 2001 From: Vinta Chen Date: Mon, 4 May 2026 17:11:34 +0800 Subject: [PATCH] remove index.md --- website/build.py | 3 --- website/templates/base.html | 2 +- website/templates/llms.txt | 3 +-- website/tests/test_build.py | 18 +++++------------- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/website/build.py b/website/build.py index 3520ce6f..88e69ab2 100644 --- a/website/build.py +++ b/website/build.py @@ -290,7 +290,6 @@ def build_llms_txt( contributing_url="https://github.com/vinta/awesome-python/blob/master/CONTRIBUTING.md", sponsorship_url=SPONSORSHIP_PUBLIC_URL, sitemap_url=SITEMAP_URL, - index_markdown_url=f"{SITE_URL}index.md", categories_md=categories_md, total_entries=total_entries, total_categories=len(categories), @@ -607,7 +606,6 @@ def build(repo_root: Path) -> None: if static_src.exists(): shutil.copytree(static_src, static_dst, dirs_exist_ok=True) - markdown_index = annotate_entries_with_stars(remove_sponsors_section(readme_text), stars_data) sponsorship_md = repo_root / "SPONSORSHIP.md" sponsorship_md_mtime = datetime.fromtimestamp(sponsorship_md.stat().st_mtime, tz=UTC).date().isoformat() llms_template = (website / "templates" / "llms.txt").read_text(encoding="utf-8") @@ -629,7 +627,6 @@ def build(repo_root: Path) -> None: sitemap_urls.append((subcategory_public_url(cat_slug, sub_slug), sitemap_date)) sitemap_urls.append((SPONSORSHIP_PUBLIC_URL, sponsorship_md_mtime)) write_sitemap_xml(site_dir / "sitemap.xml", sitemap_urls) - (site_dir / "index.md").write_text(markdown_index, encoding="utf-8") (site_dir / "llms.txt").write_text(llms_txt, encoding="utf-8") print(f"Built site with {len(parsed_groups)} groups, {len(categories)} categories") diff --git a/website/templates/base.html b/website/templates/base.html index 72f246e1..dc164347 100644 --- a/website/templates/base.html +++ b/website/templates/base.html @@ -14,7 +14,7 @@ {% block alternate_links %} - + {% endblock %} diff --git a/website/templates/llms.txt b/website/templates/llms.txt index 279f50df..401a1d38 100644 --- a/website/templates/llms.txt +++ b/website/templates/llms.txt @@ -2,12 +2,11 @@ Awesome Python is an opinionated catalog of {{ total_entries }} Python frameworks, libraries, tools, and resources across {{ total_categories }} {% if total_categories == 1 %}category{% else %}categories{% endif %}. -Scan the category index, then jump to the matching section for direct project links and short descriptions. GitHub entries with known star data end with a `GitHub stars: N` note in parentheses; treat it as popularity context, not a quality guarantee. Use the Markdown homepage for project context outside the catalog. +Scan the category index, then jump to the matching section for direct project links and short descriptions. GitHub entries with known star data end with a `GitHub stars: N` note in parentheses; treat it as popularity context, not a quality guarantee. Use the homepage for project context outside the catalog. ## Primary Links - Homepage: {{ site_url }} -- Markdown homepage: {{ index_markdown_url }} - GitHub repository: {{ github_repo_url }} - Contributing guide: {{ contributing_url }} - Sponsorship: {{ sponsorship_url }} diff --git a/website/tests/test_build.py b/website/tests/test_build.py index a5ce3290..f4781bd6 100644 --- a/website/tests/test_build.py +++ b/website/tests/test_build.py @@ -282,7 +282,7 @@ class TestBuild: assert parser.meta_by_name["description"] == "Widget libraries. Also see awesome-widgets. Explore 2 curated Python projects in Widgets." assert parser.links_by_rel["canonical"] == "https://awesome-python.com/categories/widgets/" assert parser.meta_by_property["og:url"] == "https://awesome-python.com/categories/widgets/" - assert '' not in category_html + assert '' not in category_html assert "

Widgets

" in category_html assert 'Widget libraries. Also see awesome-widgets.' in category_html assert 'href="https://example.com/w1"' in category_html @@ -292,7 +292,7 @@ class TestBuild: assert "42" in category_html assert "2026-01-01T00:00:00+00:00" in category_html - def test_build_creates_markdown_alternate_without_sponsors(self, tmp_path): + def test_build_creates_llms_text_alternate_without_sponsors(self, tmp_path): readme = textwrap.dedent("""\ # Awesome Python @@ -337,22 +337,15 @@ class TestBuild: site = tmp_path / "website" / "output" index_html = (site / "index.html").read_text(encoding="utf-8") - index_md = (site / "index.md").read_text(encoding="utf-8") llms_txt = (site / "llms.txt").read_text(encoding="utf-8") - assert '' in index_html - assert index_md.startswith("# Awesome Python\n\nIntro.\n\n# Categories") - assert "# **Sponsors**" not in index_md - assert "Sponsor" not in index_md - assert "SPONSORSHIP.md" not in index_md - assert "## Widgets" in index_md - assert "- [w1](https://example.com) - A widget." in index_md - assert "- [w2](https://github.com/owner/w2) - A starred widget. (42 GitHub stars)" in index_md + assert '' in index_html assert llms_txt.startswith("# Awesome Python\n") assert "Scan the category index" in llms_txt assert "Homepage: https://awesome-python.com/" in llms_txt - assert "Markdown homepage: https://awesome-python.com/index.md" in llms_txt + assert "Markdown homepage" not in llms_txt + assert "https://awesome-python.com/index.md" not in llms_txt assert "GitHub repository: https://github.com/vinta/awesome-python" in llms_txt assert "Contributing guide: https://github.com/vinta/awesome-python/blob/master/CONTRIBUTING.md" in llms_txt assert "Sponsorship: https://awesome-python.com/sponsorship/" in llms_txt @@ -364,7 +357,6 @@ class TestBuild: assert "- [w1](https://example.com) - A widget." in llms_txt assert "- [w2](https://github.com/owner/w2) - A starred widget. (GitHub stars: 42)" in llms_txt assert llms_txt != readme - assert llms_txt != index_md assert "# Contributing" not in llms_txt def test_build_cleans_stale_output(self, tmp_path):