feat: add paginated public collection address directory - #16
Merged
Conversation
Add src/lib/getDirectory.ts, a build-time client for the Yellowdex public API that fetches the curated owner's public collections and up to 500 addresses each (100 per page). Results are memoized per build and fetch failures degrade to an empty directory so the build never fails. Add a named "head" slot to BaseLayout so pages can inject per-page SEO tags (rel prev/next, JSON-LD).
Add the /directory address directory: an index of all public collections and per-collection pages showing a table of address, label, entity, and network, 100 rows per page. - directory/index.astro lists every public collection with links - directory/[slug]/index.astro is a collection's canonical page 1 - directory/[slug]/[page].astro serves pages 2..N (max 5, 500-address cap) - CollectionDirectoryPage.astro is the shared renderer: collection title, address table, links to other collections, and pagination controls - directory/sitemap.xml.ts emits a dynamic sitemap of every directory page Each page is SEO-optimized with a descriptive title/description, canonical URL, rel=prev/next, and CollectionPage + BreadcrumbList JSON-LD.
Add /directory to the static sitemap and the llms.txt page registry, and reference the dynamic /directory/sitemap.xml from robots.txt so crawlers discover every data-driven collection page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a public address directory at
/directory— an SEO-optimized, statically generated set of pages that projects the Yellowdex public API's public collections into browsable address/label tables.Motivation
Public collections were only reachable through the extension/app. Rendering them as indexable static pages gives each collection an SEO surface (labeled crypto addresses by entity and network) and an internal-linking hub, driving organic discovery of Yellowdex.
Changes Made
src/lib/getDirectory.ts— build-time client for the public API (sync.yellowdex.ai/api/v1). Fetches the curated owner's public collections and up to 500 addresses per collection (the API page cap), memoized per build. Fetch failures degrade to an empty directory so the build never fails (mirrorsgetLatestRelease.ts). Owner defaults toyellowdex, overridable viaPUBLIC_DIRECTORY_OWNER./directoryroutes —index.astrolists every public collection;[slug]/index.astrois a collection's canonical page 1;[slug]/[page].astroserves pages 2..N. 100 addresses per page, scoped per collection.CollectionDirectoryPage.astro— shared renderer: collection title on top, an address / label / entity / network table, links to other public collections, and pagination controls.<title>/description, canonical URL,rel=prev/next, andCollectionPage+BreadcrumbListJSON-LD (via a newheadslot onBaseLayout). JSON-LD is serialized with a<-escaping helper to prevent script-tag breakout./directoryadded to the static sitemap andllms.txt; a dynamic/directory/sitemap.xmlenumerates every generated page and is referenced fromrobots.txt.Testing
pnpm build— 115 pages generated, no errorsaavep1=100, p2=82), and the 500-address cap (aave-v3stops at page 5, no page 6)rel=prev/next, canonical, and dual JSON-LD blocks in generated HTMLBreaking Changes
Notes
deploy.ymlrebuilds keep it fresh; CI builds without extra secrets.🤖 Generated with Claude Code