feat: add author pages listing everything an author wrote - #172
Conversation
Adds an optional `authors` registry to chronicle.yaml holding each author's name, bio, avatar, url, and email. A frontmatter string that matches a registry key picks up that profile; anything else still reads as a plain name, so occasional contributors need no config. /authors lists everyone found in the content, and /authors/<slug> shows one author's profile followed by their pages grouped by content dir. The index is served from /api/authors, written to /data/authors.json for static builds, and embedded in the SSR payload so both routes render without JavaScript. A content dir named `authors` keeps its own pages. Bylines now use the registry avatar and profile link when present. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Also gives the paper-theme example an authors registry entry, so both themes demonstrate a full profile. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Author pages bypass each theme's Page component, so in paper they sat flat on the neutral backdrop while every other page rendered on a sheet. Tag the page root with the active theme and, for paper, apply the same sheet treatment its content uses — base background, side borders, soft shadow — with the theme's Hanuman body face and Departure Mono for the meta text. The profile header now stacks as avatar and name on one line, the bio below it, then the links. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Paper stacked the avatar byline under the page description. Move the authors up into the meta line as `1min Read | JANE DOE`, inheriting that line's mono face and tertiary color, with round avatars. Bylines now show two authors at most and collapse the rest into a `+N` counter that names them on hover. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The byline linked out to an author's `url`, or their email, which sent readers off-site while the author page it should reach went unlinked. Names now always go to `/authors/<slug>`, keeping the version prefix and falling back to plain text when a content dir owns that segment. An author's url and email stay on their page. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Author pages aren't MDX, so `/authors/jane.md` 404s and every item in the menu — copy, view, and both hand-offs — fails silently. Hide it there. Adds an isAuthorRoute predicate and uses it at the four places that were each spelling the check out. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Stacked on #171 — base is
feat/authors, so this diff shows only the author-page work. Retarget tomainonce #171 merges.Authors registry
chronicle.yamlgains an optional registry, so an author's details live in one place instead of on every page:A string matching a key expands to that profile; anything else still reads as a plain name, so an occasional contributor needs no config entry. A registry key and a same-named literal stay distinct authors, since slugs differ (
janevsjane-doe).Pages
/authors— everyone found in the content, with bio and page count/authors/<slug>— profile (avatar, bio, profile link, email) followed by their pages, grouped by content dir label and sorted newest first, undated last, then by titleScreenshots
The index is built once by
buildAuthorIndexand reaches the client three ways, matching how API specs already work:/api/authorsin server mode,/data/authors.jsonin static builds, and embedded in the SSR payload for/authorsroutes. That last one matters — without it these pages render blank with JavaScript disabled, which #166 established this project cares about. Verified in the served HTML:/authors/janeships the name, bio, profile link, and all page links server-side.Bylines now use the registry avatar image and link to the profile
urlwhen present, falling back to initials andmailto:as before.Decisions
authors, that content wins and author routes are skipped, so no existing site breaks. Covered by a test./authorsis the way in. It's a two-line change if that should differ./v1/authorsresolves, and the index reflects the pages the server knows about.Testing
bun test— 310 pass, 0 fail (20 new: index grouping, dir labels and fallback, sort order, registry profiles, slug collisions, route resolution including the content-dir collision)chronicle build,--preset static, and bothscripts/smoke-test.shruns (15-page crawl each)/api/authorsJSON, SSR HTML for both routes, the byline with a registry profile, and/data/authors.jsonfrom a static buildtsc --noEmitgains three errors:bun:teston the new test file, and twoTS2883h3 inference errors on the new API route — identical to the nine thatapi/specs.tsandapi/page.tsalready produce.🤖 Generated with Claude Code