feat(web): docs SEO + LLM-discoverability — llms.txt, Pagefind search, FAQ JSON-LD (SQLR-36)#172
Merged
Merged
Conversation
…, FAQ JSON-LD, docs events (SQLR-36) - /llms.txt (curated index) + /llms-full.txt (full docs+blog markdown) + /docs.md (raw-markdown docs), all force-static, referenced from a hand-rolled /robots.txt route (replaces the typed robots.ts) - Pagefind docs search: postbuild index of .next/server/app scoped via data-pagefind-body, custom dark-themed UI on /docs - Heading anchors: H2 helper on /docs, rehype-slug + autolink on blog MDX - Blog articles: on-page ToC (>600 words), tag-ranked related posts - /docs: Related footer (5 links) + helpful-vote widget - Landing FAQ: 8 h3/p pairs mirrored into FAQPage JSON-LD - PostHog custom events: docs-search-query, docs-helpful-vote (no-op without NEXT_PUBLIC_POSTHOG_KEY) - Fixed the one bare code fence (ASCII diagram -> ```text) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Implements SQLR-36 — docs SEO + LLM-discoverability for sqlritedb.com.
What changed
Classical docs SEO
#link on each/docs<h2>(localH2helper) and every blog heading (rehype-slug+rehype-autolink-headings). Slugs computed withgithub-sluggerso the ToC and rendered ids always match.```text.Search (Pagefind — static, serverless, free)
postbuildscript indexes the prerendered HTML in.next/server/app, scoped viadata-pagefind-body(docs + blog only). Custom dark-themed search UI on/docs(docs-search.tsx) using Pagefind's JS API. Index is gitignored (build artifact);next devdegrades to a hint.LLM surfaces (llmstxt.org)
/llms.txt— curated index: project tagline + sections of absolute links with one-line summaries (docs, playground, every blog post, GitHub/docs.rs/registries)./llms-full.txt— full docs markdown + every blog post concatenated./docs.md— docs page as rawtext/markdownfor crawlers that prefer markdown.force-static(built at build time) viasrc/lib/llms.ts. Docs markdown source:content/docs/getting-started.md(mirrorsdocs/page.tsx).robots.ts→ hand-rolledrobots.txtroute that references both llms files.JSON-LD
FAQPageJSON-LD generated from the same array as the visible<h3>/<p>pairs, so they can't drift.Analytics (PostHog was already wired)
useTrack()hook that no-ops withoutNEXT_PUBLIC_POSTHOG_KEY:docs-search-query(debounced; query + result count) anddocs-helpful-vote(path + boolean). No PII, no cookie banner.No doc URLs moved (no redirects needed). No CMS.
web/README.mdupdated throughout.Verification
npm run typecheck✅ ·npm run lint✅ (only a pre-existing warning in untouchedexamples/page.tsx) ·npm run build+ postbuild ✅ (Pagefind indexed 7 pages)./robots.txt,/llms.txt,/llms-full.txt(text/plain),/docs.md(text/markdown),/pagefind/pagefind.js(200).SoftwareApplication+FAQPage(8 questions) on/,BlogPosting+BreadcrumbListon posts.search()returns ranked results with<mark>highlighting; the docs search box (React component) returns 5 results for "transaction" with.htmlURLs correctly mapped to clean routes; heading-anchor click updates the URL fragment; helpful-vote click → "Thanks!" state; 24 heading anchors + 5 related links present; FAQ renders 8 Q/A pairs. Analytics no-op path confirmed (no PostHog global, no console throw when key absent).🤖 Generated with Claude Code