This repository was archived by the owner on Oct 13, 2026. It is now read-only.
Repository navigation
feat(seo): per-page meta descriptions and markdown-free titles - #30
Merged
Merged
Conversation
Every built page now carries a canonical URL at the trailing-slash address GitHub Pages serves it from, Open Graph and twitter:card tags, and one JSON-LD block: WebSite plus SoftwareSourceCode on the home page, TechArticle plus BreadcrumbList on doc pages. The build also writes dist/sitemap.xml listing every page. It has no <lastmod> because the deploy checkout is shallow and cannot date pages from git history. Titles and the meta description are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the squash merge of #29 so the follow-up PR only shows new changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each doc page's meta description, og:description and TechArticle description now come from its first prose paragraph after the H1, trimmed at a word boundary to 155 characters. Lists, tables, code, blockquotes, images, lead-ins ending in a colon, bold-label callouts, asides and "See ..." pointers are skipped. The home page keeps the site description, as does any page with no usable paragraph; the build logs those (today: glossary). Titles in <title>, og:title, the JSON-LD headline and the search index use the H1's visible text, so the cross-wiki-diff title loses its literal backticks. The search index excerpt now uses the same description, replacing the regex-based getExcerpt(), which left list markers and ** in excerpts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The site described Refract three ways: the home H1 said "observation layer for model evaluation", the meta description and sidebar said "the open claim-history layer for public knowledge", and AGENTS.md says to describe it as a deterministic observation engine, which is what the README leads with. The home H1, the site description, the sidebar tagline and the opening sentences of Why Refract and Concepts now use the README line. Those openings are the pages' meta descriptions now. The home <title> no longer appends "— Refract" to an H1 that already starts with the name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Follow-up to #29, which merged before these two fixes landed. That PR left two gaps:
<title>andog:title.Each doc page now gets a description taken from its own text. Titles now use the H1's visible text.
Changes
<meta name="description">,og:descriptionand the TechArticledescriptioncome from the page's first prose paragraph after the H1:.,!or?), which skips lead-ins such as "Use environment variables instead:";**Quick start**: …, glossary entries**Claim** — …), parenthetical asides, "See [page] …" pointers and image-only paragraphs are skipped;glossaryonly, because it is all**Term** — definitionentries.<title>,og:title, the JSON-LDheadlineand the search index use the visible text of the H1. "Tutorial: Cross-wiki comparison with `refract diff`" becomes "Tutorial: Cross-wiki comparison with refract diff". The body H1 still rendersrefract diffas code, and heading anchors are unchanged. Breadcrumb names come fromdocs/nav.jsonlabels, not from the H1. None of those labels contains markdown, and the new test covers them.excerptnow uses the same description. This replacesgetExcerpt(), a regex excerpt that left list markers and**in the text. For example, install's excerpt was "- Node.js 20+ or Bun v1.2+".tests/seo.test.ts, 5 new):<title>matches the visible H1 text;index,glossary);Sample descriptions:
tutorials/fandom-canoninterpretationmcpPages whose first prose paragraph is a weak summary
The rule picks these paragraphs correctly, but the pages have no intro sentence, so the description describes one section rather than the page. A one-sentence intro under each H1 would fix them. That is a copy decision, so this PR leaves the markdown alone.
install: "Run the CLI as node packages/cli/dist/src/cli.js , …" (from the build-from-source section).security: "When using --cache, revision content is persisted to ~/.wikihistory/refract.db …"schema: "ModelInterpretation and modelInterpretation on EvidenceEvent are never set …"quickstart: "By default, this fetches up to 20 recent revisions …" ("this" refers to a code block).cli: "All commands work with wikihistory as a backward-compatible alias …"faq: the rate-limit answer.frontier-use-cases: "It does not report what a document says now. …"Verification
npm run lint: no errors. The 3 warnings are the existingnoDescendingSpecificityones inassets/style.css.npm test: 4 files, 75 tests pass (70 on main).npm run build: 53 pages built, and it logs the one fallback page (glossary).xmllint --noout dist/sitemap.xmlpasses with 53 URLs, and JSON-LD parses on all 53 pages.Positioning line (commit 6965eec)
The site described Refract three ways. AGENTS.md says to "describe Refract as a deterministic observation engine", which is how the README leads, so that wording now appears everywhere it was stated:
<title>The home subtitle, which mentions model evaluation as a use, is unchanged, and so are the model-evaluation pages. A title that already starts with "Refract" no longer gets a "— Refract" suffix. Lint, 75 tests and the build pass.
🤖 Generated with Claude Code