Commit Graph

2414 Commits

Author SHA1 Message Date
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
138059feeb feat(website): add Awesome Python and Sponsorship links to footer
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 19:05:40 +08:00
Vinta Chen
f57fc44295 style: bump tag font size to var(--text-xs) and codify 12px minimum font-size rule
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 18:54:23 +08:00
Vinta Chen
f3f92c691a feat(website): render subcategory, group, and source tags as anchor elements
Convert <button> tags for subcategory, group, and source filters to <a>
elements with href attributes so browsers surface URL preview on hover,
support open-in-new-tab, and allow middle-click navigation.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 18:49:34 +08:00
Vinta Chen
9de86ea785 feat(website): append #library-index to tag links on non-index pages
Tag clicks on category/other pages now land with the results section
scrolled into view.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 18:45:09 +08:00
Vinta Chen
fc8d1ba35e feat(website): show desc-row on index page when a filter is active
On category pages desc-rows are always visible. On the index page they
were always hidden. Now they become visible whenever a tag/category
filter is applied, giving filtered results the same richness as category
pages.

Also tightens two related CSS rules: border-bottom suppression only
fires when the adjacent desc-row is actually visible, and the expand-row
description is hidden while the desc-row is already showing to avoid
duplicate text.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 13:08:27 +08:00
Vinta Chen
1afccd8bc9 update description for curses 2026-05-03 12:53:56 +08:00
Vinta Chen
1468ae78ff feat(website): show project description as always-visible desc-row on category pages
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 12:47:17 +08:00
Vinta Chen
d7a916837c Merge pull request #3106 from vinta/feature/better-seo-2
Static category pages and path-based filter URLs
2026-05-03 12:38:12 +08:00
Vinta Chen
0c20fee458 build: add ty config and reorder tool sections in pyproject.toml
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 12:34:33 +08:00
Vinta Chen
3d99f7336d style(website): apply ruff format
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 12:23:55 +08:00
Vinta Chen
432a1f4b71 build: add lint, format, typecheck make targets and ty dependency
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 12:23:37 +08:00
Vinta Chen
d3f35a9d21 test(website): remove redundant and brittle tests
Drops tests that either duplicate coverage already provided by adjacent
cases (single-word slugify, trailing-slash checks) or hard-code first-
category names and specific description strings that break whenever the
README content shifts.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 12:19:32 +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
8a32d27ef5 fix(website): tighten sponsorship page copy for clarity
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 09:46:50 +08:00
Vinta Chen
40913c3df3 fix double quotes 2026-05-03 09:38:28 +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
b82a254a09 fix(website): clear filter lands at /#library-index on category pages
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 09:03:25 +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
033694204c feat(website): move descriptions into expand row on category pages
Removes inline .category-row-desc from the name cell and renders
entry.description inside .expand-content instead, matching the
index page pattern. Drops the now-unused CSS rules for
.category-row-desc and the overridden .category-table .expand-content
padding.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 08:17:17 +08:00
Vinta Chen
03db91bcd0 style(website): left-align results note on category pages
Switch justify-self from end to start so the "Sorted by GitHub stars..."
note sits flush left under the heading instead of right-aligned.
2026-05-03 08:02:39 +08:00
Vinta Chen
1139402838 fix(website): stop category-page heading from wrapping
The results-intro grid (1fr + 28rem note column) squeezed the heading on
category pages with long names, e.g. "Python Projects in Environment
Management" wrapped onto two lines.

Scope a single-column override to .category-results so the heading takes
the full row and the note drops below right-aligned. Index page layout
is untouched since its heading is short.
2026-05-03 08:01:37 +08:00
Vinta Chen
8e72e8af8f feat(website): strip #library-index from URL after All projects click
The "All projects" link in the category-page topbar pointed to
/#library-index so the browser would scroll to the library section on
arrival. The hash stayed in the URL, which looked like an internal anchor
state rather than a clean homepage URL.

On homepage load, if the hash is #library-index, scroll to the section
explicitly and use history.replaceState to drop the hash from the URL.
The scrollIntoView call covers the case where the script runs before the
browser's native anchor scroll, since replaceState removes the hash the
browser would have used.
2026-05-03 07:56:54 +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
b0136ac266 feat(website): switch index filter URLs from querystring to path
Tag clicks on / pushState a category/group/subcategory path; on static
pages they fully navigate. Search and sort stay in querystring. Built-in
source tag has no data-url and stays as an in-page filter. The
isIndexDocument flag is captured at load time so toggling on the index
keeps working after pushState changes location.pathname.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 00:49:41 +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
e320ba7278 test(website): restore exact sitemap URL list and lastmod count check
Membership-only assertions wouldn't catch phantom URLs added by future
build changes. Tighten back to an exact-list assertion now that we know
the fixture's exact output, and assert lastmod count tracks loc count.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 00:35:11 +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
20df47e1e9 style(website): add CSS for category-breadcrumb and assert absence on parent
Mirrors the .category-subtitle a underline style for visual cohesion in
the hero, and locks in the gating behavior with a negative assertion so
a regression that drops the page_kind guard would be caught.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 00:30:56 +08:00
Vinta Chen
03702231af feat(website): show parent category breadcrumb on subcategory pages
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 00:27:22 +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
cee1e65fb3 test(website): hoist pytest import to module level
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 00:17:53 +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
a46b57e428 fix(readme): rename group "Miscellaneous" to "Other"
Avoids a slug collision between the group "Miscellaneous" and the
category of the same name once both share the /categories/ URL
namespace introduced in the upcoming filter-URL refactor.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 00:15:19 +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
7fadbaf6fe feat(website): add homepage category directory 2026-05-02 23:44:27 +08:00
Vinta Chen
b00395a301 add missing links of category descriptions 2026-05-02 23:35:24 +08:00
Vinta Chen
c98cbe2cb1 style(website): clarify category section heading 2026-05-02 23:31:34 +08:00
Vinta Chen
e11afd1730 feat(website): generate static category pages 2026-05-02 23:31:08 +08:00