mirror of
https://github.com/vinta/awesome-python.git
synced 2026-05-10 15:50:00 -05:00
feat(website): generate static pages for subcategories
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -542,6 +542,41 @@ class TestBuild:
|
||||
assert 'id="hero-category-heading">Browse by category</h2>' in html
|
||||
assert 'class="hero-category-link" href="/categories/ai-and-agents/"' in html
|
||||
|
||||
def test_build_creates_subcategory_pages(self, tmp_path):
|
||||
readme = textwrap.dedent("""\
|
||||
# T
|
||||
|
||||
---
|
||||
|
||||
**Web**
|
||||
|
||||
## Web Frameworks
|
||||
|
||||
- Synchronous
|
||||
|
||||
- [django](https://example.com/django) - Sync framework.
|
||||
|
||||
- Asynchronous
|
||||
|
||||
- [fastapi](https://example.com/fastapi) - Async framework.
|
||||
|
||||
# Contributing
|
||||
|
||||
Done.
|
||||
""")
|
||||
self._copy_real_templates(tmp_path)
|
||||
(tmp_path / "README.md").write_text(readme, encoding="utf-8")
|
||||
build(tmp_path)
|
||||
|
||||
site = tmp_path / "website" / "output"
|
||||
sync = (site / "categories" / "web-frameworks" / "synchronous" / "index.html").read_text(encoding="utf-8")
|
||||
async_ = (site / "categories" / "web-frameworks" / "asynchronous" / "index.html").read_text(encoding="utf-8")
|
||||
|
||||
assert "django" in sync
|
||||
assert "fastapi" not in sync
|
||||
assert "fastapi" in async_
|
||||
assert "django" not in async_
|
||||
|
||||
def test_build_creates_group_pages(self, tmp_path):
|
||||
readme = textwrap.dedent("""\
|
||||
# T
|
||||
|
||||
Reference in New Issue
Block a user