Commit Graph

61 Commits

Author SHA1 Message Date
Vinta Chen
10c06fb26d add category links in llms.txt 2026-05-07 20:00:56 +08:00
Vinta Chen
6c18b6447e feat: use explicit Projects section in README 2026-05-04 21:24:57 +08:00
Vinta Chen
921d47b455 remove index.md 2026-05-04 17:11:34 +08:00
Vinta Chen
3510db9df9 update llms.txt 2026-05-04 17:05:05 +08:00
Vinta Chen
509ebaff7a use file modification time as lastmod in sitemap 2026-05-04 16:24:52 +08:00
Vinta Chen
9379e0a42c style(sitemap): pretty-print generated sitemap.xml with 2-space indent
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 20:16:13 +08:00
Vinta Chen
c886e470b6 feat(website): lead category meta description with real description when present, count first as fallback
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 19:57:31 +08:00
Vinta Chen
2f398acefb fix(seo): align JSON-LD with Yoast/RankMath conventions
- Wrap category pages in a self-contained @graph (WebSite + CollectionPage)
- Set canonical @id on CollectionPage to its URL (no hash fragment)
- Expand isPartOf to typed object {"@type": "WebSite", "@id": ...}
- Extract _website_node() and ISPARTOF_WEBSITE constants to avoid repetition
- Update tests to assert @graph structure on category pages

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 19:31:14 +08:00
Vinta Chen
86d2aa7e01 feat(website): add CollectionPage JSON-LD to category, group, and subcategory pages
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 19:23:14 +08:00
Vinta Chen
b2910d59c8 feat(website): add homepage JSON-LD with WebSite, CollectionPage, ItemList for SEO/AEO
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 19:18:15 +08:00
Vinta Chen
a068219684 fix(website): type build template entries 2026-05-03 12:08:41 +08:00
Vinta Chen
38b54caabb fix(website): trim sponsorship page nav and hero stats
Remove the 'All projects' nav link and total_entries hero stat from the
sponsorship page. Rename 'View the repository' CTA to 'View on GitHub'.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 11:45:07 +08:00
Vinta Chen
ee01a0bade refactor(website): extract render_category, replace slugify filter with filter_urls map
- Extract render_category() helper to deduplicate the three category/group/builtin
  rendering blocks in build.py
- Replace synthetic dict literals with synthetic_category() helper
- Rewrite subcategory rendering to avoid O(n²) loop using precomputed dicts
- Pass filter_urls (not just JSON) to templates so Jinja can look up group URLs
  directly instead of applying the slugify filter at render time
- Remove slugify from env.filters (no longer used in templates)
- Replace isIndexPage() wrapper with isIndexDocument constant in main.js
- Fix: call applyFilters() on page load when activeFilter is set
- Remove dead else branch in tag click handler (category pages with no URL)
- Switch .hero-category-links from CSS columns to CSS grid for more even layout
- Remove max-width cap on .category-subtitle

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 11:38:22 +08:00
Vinta Chen
c68b985d7c feat(website): add /sponsorship/ landing page
Adds a dedicated sponsorship page at /sponsorship/ built from the Jinja2
template, with hero stats, tier cards, and CSS. Updates the index.html
sponsor sidebar link to point to /sponsorship/ instead of the GitHub
SPONSORSHIP.md. Adds the URL to the sitemap and test fixtures.

Also renames .impeccable.md to DESIGN.md.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 09:35:39 +08:00
Vinta Chen
64781112d8 feat(website): add Browse by category nav to group page hero
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 09:08:37 +08:00
Vinta Chen
70a8255289 feat(website): add /categories/built-in/ page for Built-in tag filter
Register Built-in as a navigable filter path alongside regular category
and group slugs, emit the page during build, add it to the sitemap, and
wire the Built-in tag buttons in index.html and category.html to navigate
there via data-url.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 08:35:55 +08:00
Vinta Chen
d64b47b910 feat(website): mirror index layout on category pages
Add search input, filter chips, no-results block, and back-to-top
button to category/group/subcategory pages. Pass filter_urls_json to
all page types so tag-chip navigation works site-wide. Fix JS so
filter-clear and no-results-clear redirect to / on non-index pages
instead of trying to filter a non-existent local table. Remove the
now-redundant .category-results CSS overrides.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 08:26:37 +08:00
Vinta Chen
8e00055c8c fix(website): remove duplicate tag on group/category pages
The category template rendered a tag for `category.name` plus a tag for
`entry.groups[0]`, which duplicated the group name on group pages where
those values are identical (e.g. /categories/python-language/ showing
"Python Language" twice). It also never rendered `entry.categories`, so
group pages omitted each project's actual category.

Mirror the index template's tag rendering on category, group, and
subcategory pages, and mark whichever tag matches the current page URL
as active. Pass `category_urls` and `current_path` to each render call
so the template can match by URL.
2026-05-03 07:51:39 +08:00
Vinta Chen
04a04a136b feat(website): add data-url to tag buttons for client-side routing
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 00:44:43 +08:00
Vinta Chen
704332271b fix(website): escape </script> in embedded filter URLs JSON
`| safe` bypasses Jinja autoescape. If a category name ever contained
"</script>", the literal substring would close the script block early,
leaking JSON content into the DOM and creating an XSS vector. Replace
"</" with "<\\/" (still valid JSON) and pass ensure_ascii=False so
non-ASCII names render readably. Also add a group_path() helper to
parallel category_path()/subcategory_path() and reuse category_urls
when seeding filter_urls.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 00:40:52 +08:00
Vinta Chen
e0e7fc9168 feat(website): embed filter-to-url map in index for client routing
Adds filter_urls dict (categories, groups, subcategories) in build.py,
passes filter_urls_json to the template, and injects a JSON script block
before the results section in index.html. Covered by a new test that
verifies all three URL types are present and correctly resolved.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 00:36:41 +08:00
Vinta Chen
fe7fd35e18 feat(website): include group and subcategory URLs in sitemap
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 00:32:21 +08:00
Vinta Chen
6bc9d83480 refactor(website): match subcategory by URL prefix instead of name split
Use the precomputed sub["url"] to identify which subcategories belong
to a category. Avoids parsing the "Cat > Sub" value string, which would
silently misfire if a category name ever contained " > ".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 00:26:12 +08:00
Vinta Chen
eeecacc3bd feat(website): generate static pages for subcategories
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 00:23:14 +08:00
Vinta Chen
532d93d436 feat(website): generate static pages for groups under /categories/
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 00:19:14 +08:00
Vinta Chen
583d5e7c51 feat(website): assert unique slugs across categories and groups
Categories and groups will share the /categories/ URL namespace.
Fail the build with a clear error message if a future README change
introduces a collision.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 00:15:25 +08:00
Vinta Chen
39d4b3db4b feat(website): add subcategory_path and subcategory_public_url helpers
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 00:08:04 +08:00
Vinta Chen
4005c2ea82 feat(website): add slug and url to subcategory entries
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 00:05:02 +08:00
Vinta Chen
e11afd1730 feat(website): generate static category pages 2026-05-02 23:31:08 +08:00
Vinta Chen
429c9b3d12 feat: generate llms.txt from template and annotate entries with star counts
- Add llms.txt Jinja2 template with a categories_md placeholder
- Extract categories body from README and inject it into the template
- Annotate bullet-entry lines with GitHub star counts (N GitHub stars)
  for the main index.md and bare numbers for llms.txt
- Add TestAnnotateEntriesWithStars unit tests

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-02 02:32:18 +08:00
Vinta Chen
d9f26a8635 Improve SEO/AEO discovery surface for awesome-python.com (#3103)
* update gitignore

* feat: tighten homepage metadata

* fix: trim generated HTML whitespace

* feat(website): add discovery files and markdown alternate

* feat(website): add sitemap lastmod

* feat(seo): add Content-Signal directive to robots.txt

Signals search, ai-input, and ai-train to crawlers
via the experimental Content-Signal header in robots.txt.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-05-02 01:53:19 +08:00
Vinta Chen
0630ee973b refactor(build): flatten extract_entries and annotate result dict
Collapse the if-seen/else-new branches so the category/group/subcategory
merge logic runs once per entry unconditionally, appending to empty lists
on first sight instead of duplicating the append logic in the else branch.

Annotate seen and entries as dict[str, Any] so ty can resolve the mixed
value types (str, list, None) in each entry dict.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-19 22:04:14 +08:00
Vinta Chen
39b65bc994 refactor(build): inline format_stars_short into its call site
The helper only appeared once and the logic is two lines, so the named
function added indirection without clarity. Removed the four dedicated
unit tests that covered the function directly.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-19 22:00:45 +08:00
Vinta Chen
7e7de19ef6 refactor(build): remove StarData TypedDict, loosen load_stars return to dict[str, dict]
Cache-write shape mismatches the TypedDict and callers mix .get() and
direct access, so the stricter type was providing false safety. Using
dict[str, dict] accurately reflects the actual runtime contract.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-19 21:57:30 +08:00
Vinta Chen
7f4a163534 refactor(build): tighten extract_entries parameter types to ParsedSection/ParsedGroup
Replace loose list[dict] annotations with concrete TypedDicts imported
from readme_parser so ty can verify call-site compatibility.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-19 21:56:46 +08:00
Vinta Chen
c85f81bb24 refactor(build): accept Path directly in build() signature
Remove internal str->Path conversion; callers and tests now pass
Path objects directly.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-19 21:56:06 +08:00
Vinta Chen
a358d45ca4 refactor: use datetime.UTC alias instead of timezone.utc
Python 3.11 introduced datetime.UTC as a cleaner alias for
datetime.timezone.utc. Both build.py and fetch_github_stars.py
are updated to use the shorter form.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-19 21:54:55 +08:00
Vinta Chen
774ab69bcd feat(website): add sponsors section parsed from README
Parse the # Sponsors heading in README.md into structured data and
render a dedicated sponsor band above the library index on the site.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-19 21:10:50 +08:00
Vinta Chen
f27b7c80fb feat(website): add social proof line to hero with star count and build date
Display the awesome-python repo's star count (formatted as '230k+') and
the last data refresh date below the hero CTA. Fetches the self-repo
star count by always including vinta/awesome-python in the stars fetch.
Also removes the footer date stamp, which is now surfaced in the hero.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-23 01:56:15 +08:00
Vinta Chen
25a3f4d903 refactor(parser): remove resources parsing, preview, and content_html fields
parse_readme now returns list[ParsedGroup] instead of a tuple. The
resources section (Newsletters, Podcasts), preview string, and
content_html rendering are no longer produced by the parser or consumed
by the build. Removes _render_section_html, _group_by_h2, and the
associated dead code and tests.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-23 01:43:19 +08:00
Vinta Chen
0c26d352f0 fix(website): scope subcategory filter values to parent category
Subcategories with the same name (e.g. 'Frameworks') across different
top-level categories were sharing a filter value, so clicking one
subcategory tag would match entries from unrelated categories.

Each subcategory now stores both a display name and a scoped value
('Category > Subcategory') used for data-cats matching. The template
renders the display name on tags and mobile-cat span, but uses the
scoped value for filtering. Subcategory tags are also moved before
category tags so the most-specific label appears first.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-23 01:11:35 +08:00
Vinta Chen
f2b4a7bc83 feat(website): surface subcategory labels as filterable tags
Entries nested under a plain-text subcategory heading (e.g. "Frameworks"
inside Testing) now carry a subcategory field populated by the parser.
The build pipeline collects these into a subcategories list on each merged
entry, and the template renders them as tag-subcat buttons that plug into
the existing data-cats filter mechanism.

A dedicated .tag-subcat style distinguishes them visually from category
tags, and both are hidden on mobile alongside .tag-group.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-23 01:04:20 +08:00
Vinta Chen
df2191fc05 refactor(build): remove unused group_categories wrapper
group_categories only ever appended a Resources group when the
resources list was non-empty. All call sites passed an empty list,
making it a no-op indirection. Inline parsed_groups directly and
remove the dead code along with its tests.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-22 15:58:42 +08:00
Vinta Chen
5fc022d595 refactor(build): remove resources from build pipeline
Resources are no longer passed through parse_readme, group_categories,
or the index template — they are replaced with empty lists and the
unused variable is prefixed with an underscore.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-22 15:45:18 +08:00
Vinta Chen
d3070b735e feat: add build date to footer
Displays the UTC date the site was last built in the footer so visitors
can see how fresh the data is.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-22 15:30:04 +08:00
Vinta Chen
4f297a5301 fix(website): sort starred stdlib entries after starred non-stdlib entries
Within the same star count, built-in (stdlib) entries were interleaved
with third-party entries. Add a builtin tier to the sort key so stdlib
entries always rank below non-stdlib entries at equal star counts.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-22 02:15:22 +08:00
Vinta Chen
37a9443bbb fix(website): map built-in entries to cpython for star data lookup
Entries with source_type 'Built-in' have no extractable GitHub repo key
from their URL, so they never received star/metadata enrichment. Fall
back to python/cpython for these entries so the star count and related
data are populated correctly.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-22 02:10:44 +08:00
Vinta Chen
8e7b881659 fix(website): key dedup by (url, name) to allow same-url different-name entries
Previously, two entries sharing the same URL but different names would be
collapsed into one. Using a composite (url, name) key preserves distinct
entries while still merging true duplicates.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-22 02:08:42 +08:00
Vinta Chen
bfaa207ef3 refactor(website): rename stdlib source type label to Built-in
Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-22 02:04:45 +08:00
Vinta Chen
666f6e52d0 feat(website): add source type badges for non-GitHub entries
Detect the hosting source (stdlib, GitLab, Bitbucket, External) from
the entry URL and surface it as a small badge in the stars column where
a star count would otherwise show an em dash.

Stdlib entries also get their own sort tier — between starred entries
and other no-star entries — so the standard library is not buried at
the bottom of each category.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-22 02:03:00 +08:00