Skip to content

Normalize page titles, audit page heads, list every port tree in a sitemap - #245

Merged
tony merged 38 commits into
mainfrom
feat/title-meta-audit-20261101
Nov 22, 2026
Merged

tony merged 38 commits into
mainfrom
feat/title-meta-audit-20261101

Conversation

@tony

@tony tony commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

A tab said capabilities | libtmux-ts for a TypeScript MCP resource: nothing about MCP, a resource or TypeScript. Sibling pages shared titles, one sitemap listed the shell's pages and none of the language homes, and nobody could see what each page tells a tab, a crawler or a link card without opening it. This PR gives every page one title scheme, adds an on-demand audit of every page head, and makes the sitemaps follow each page's own head and each port tree.

The branch is rebuilt on current main. The language home titles (#232) and the language library card artwork (#244) that it was stacked behind have merged. The tmux 3.2a documentation tree stays: 3.2a is the support floor, and this PR titles and lists its pages like those of any other tmux version (tmux choose-tree | tmux manual (3.2a) | libtmux.org). An earlier revision of this branch dropped that tree; that change is not part of this PR.

Inventory: where each head tag comes from

Tag or file Written by
<title>, og:title, twitter:title, JSON-LD headline Seo.astro through documentationTitle, for every Astro page that renders BaseLayout. The title argument is the page's title or shortTitle.
<title> of a redirect stub site/src/components/docs/RedirectPage.astro, its own head with the title the documentation or a product name. Stubs are noindex and canonical to their destination.
<title> of the search page and 404 BaseLayout with a fixed name (Search, Page not found); scripts/normalize-native-shell.mjs writes a Search stub for native trees.
<title>, og:*, twitter:*, icons, manifest of a native (Sphinx) page nativeBrandHead in scripts/brand-native-pages.mjs, after the native tree is copied. It keeps the generator's canonical and robots tags.
meta description Seo.astro from the page's description (front matter, MCP and API summaries, portHomeDescription); falls back to a per-section constant in Seo.astro. Native pages keep the generator's.
canonical Seo.astro through canonicalUrl in site/src/lib/versions.ts; canonicalOverride for placeholders and the tmux manual.
robots Seo.astro through robotsFor in versions.ts, plus a page's noindex; robots.txt comes from site/src/pages/robots.txt.ts.
og:site_name, og:image*, twitter:image*, og:locale Seo.astro; artwork URLs come from branding() and pageBrand() in branding.ts and ports.ts.
icon, apple-touch-icon, mask-icon, manifest, msapplication-config, theme-color site/src/components/BrandIcons.astro (unchanged); ShellHead.astro for the shell's scripts and fonts only.
hreflang alternates Seo.astro, only for a page with a real translation (locales.length > 1).
link rel=alternate type=text/markdown BaseLayout.astro, through markdownPath.
link rel=sitemap Seo.astro and nativeBrandHead (new).
Shell sitemap @astrojs/sitemap in site/astro.config.ts.
Port tree sitemap writePortSitemap in scripts/gen-port-sitemap.mjs, run by scripts/build-site.sh (new).

Title scheme

<Page> | <Language> <Product> <kind> | libtmux.org: the page's own name first, so a narrow tab still tells pages apart; then the language, the product when it is not the core library (MCP, Workspace) and the kind of page; then the site. The context is left out when the name already says it, a non-default version is named in it (TypeScript guide (v0.2.0), tmux manual (3.2a)), and a language home keeps the title #232 sets, libtmux-ts: TypeScript-based tmux client, with no context or site name. documentationTitle builds the tab, the card title and the context from that one scheme for Astro pages and, through nativeBrandHead, for native pages.

The budget is TITLE_BUDGET, 60 characters. Google states no limit: a title link is "truncated in Google Search results as needed, typically to fit the device width" (Influence your title links, read 2026-11-01), and a tab strip shows far less. 60 is the working figure that keeps the name, language and kind in view; the name leads so truncation costs the least. A title that would pass it gives up the site name first and then the word "reference" (LibTmux.Mcp.BoundedText.ToDisplayString | C# MCP API); a name no context can rescue keeps its whole context. The same text without the site name is og:title and twitter:title, because og:site_name ("the name which should be displayed for the overall site", ogp.me) already prints the site. SITE_NAME, libtmux.org, is og:site_name and the WebSite name on every page; they were the project name on port pages and libtmux.org on tmux pages.

Core library pages carry no product word (Rust guide), and MCP and Workspace pages do (Rust MCP tool, Rust Workspace CLI). A tmux C declaration's page names its kind from its slug (tmux C function, tmux C struct), and the tmux section's guides, manual and catalog are tmux guide, tmux manual, tmux format.

Section Page Before (production, 2026-11-01) After
Site home /en/ libtmux: pilot tmux in your language unchanged
Language home /en/ts/latest/ TypeScript latest | libtmux-ts libtmux-ts: TypeScript-based tmux client (set by #232, kept)
Core library page /en/ts/latest/core/ (new in #232) tmux client library for TypeScript | libtmux.org
MCP home /en/ts/latest/mcp/ tmux MCP, built in TypeScript | libtmux-ts tmux MCP, built in TypeScript | libtmux.org
Workspace home /en/ts/latest/workspace/ TypeScript-based tmux workspace manager | libtmux-ts TypeScript-based tmux workspace manager | libtmux.org
Guide /en/ts/latest/guides/attaching-to-tmux/ Attaching to tmux | libtmux-ts Attaching to tmux | TypeScript guide | libtmux.org
Topic /en/ts/latest/topics/environment/ Environment | libtmux-ts Environment | TypeScript topic | libtmux.org
Concept /en/ts/latest/concepts/queries/ Filtering and queries | libtmux-ts Filtering and queries | TypeScript concept | libtmux.org
Example /en/ts/latest/examples/attach-and-send-keys/ Attach and send keys | libtmux-ts Attach and send keys | TypeScript example | libtmux.org
MCP resource /en/ts/latest/mcp/resources/capabilities/ capabilities | libtmux-ts capabilities | TypeScript MCP resource | libtmux.org
MCP tool /en/cxx/latest/mcp/tools/kill_pane/ kill_pane | libtmux-cxx kill_pane | C++ MCP tool | libtmux.org
Workspace CLI /en/ts/latest/workspace/cli/convert/ Convert workspace files | libtmux-ts Convert workspace files | TypeScript Workspace CLI
Workspace configuration /en/ts/latest/workspace/configuration/windows/ Window configuration | libtmux-ts Window configuration | TypeScript Workspace configuration
Workspace API reference /en/ts/latest/workspace/reference/ownership-claimsession/ ownership.claimSession | libtmux-ts ownership.claimSession | TypeScript Workspace API reference
Workspace API reference, shortened to fit /en/cxx/latest/workspace/reference/libtmux-workspace-pane-focus/ libtmux::workspace::Pane::focus | libtmux-cxx libtmux::workspace::Pane::focus | C++ Workspace API
MCP API reference, shortened to fit /en/csharp/latest/mcp/reference/libtmux-mcp-channelwaitresult-elapsedseconds/ LibTmux.Mcp.ChannelWaitResult.ElapsedSeconds | libtmux-dotnet LibTmux.Mcp.ChannelWaitResult.ElapsedSeconds | C# MCP API
Core section index /en/java/latest/guides/ Guides | libtmux-java Guides | Java docs | libtmux.org
Workspace section index /en/java/latest/workspace/guides/ Guides | libtmux-java Guides | Java Workspace docs | libtmux.org
tmux overview /en/tmux/ tmux | libtmux.org tmux | libtmux.org
tmux guide /en/tmux/guides/sending-keys/ Sending keys | Guides | tmux | libtmux.org Sending keys | tmux guide | libtmux.org
tmux manual /en/tmux/latest/manual/choose-tree/ tmux choose-tree | Manual | tmux | libtmux.org tmux choose-tree | tmux manual | libtmux.org
tmux manual, support floor /en/tmux/3.2a/manual/choose-tree/ (not read) tmux choose-tree | tmux manual (3.2a) | libtmux.org
tmux catalog /en/tmux/latest/catalog/formats/cursor_y/ cursor_y | tmux | libtmux.org cursor_y | tmux format | libtmux.org
tmux C declaration /en/tmux/latest/reference/c-struct-input_ctx-request_timer/ input_ctx.request_timer | Reference | tmux | libtmux.org input_ctx.request_timer | tmux C struct | libtmux.org
tmux C declaration /en/tmux/latest/reference/c-function-args_parse/ args_parse | Reference | tmux | libtmux.org args_parse | tmux C function | libtmux.org
Shared site page /en/meta/support/ Support and release stages | libtmux Support and release stages | libtmux.org
Agent prompts /en/prompts/ Agent prompts | libtmux Agent prompts | libtmux.org
Native Python API page /en/py/latest/api/... Servers - libtmux 0.62.0 documentation | libtmux Servers | Python API reference | libtmux.org

The "After" column is the output of documentationTitle on current main for each page name. Measured over the 12,149 production pages the audit read on 2026-11-01 (before: production; after: the scheme applied to each page's name that day): titles with no language 2,963 -> 0, slug-cased titles 410 -> 0, titles over 60 characters 1,610 -> 648 (long qualified identifiers; the name alone is over budget), duplicate titles among indexable pages 91 -> 13 (anonymous C enums). The C declaration kind was added after that measurement: 57 reference pages that shared a title with a page of another kind (a function and a struct of one name) now differ.

Meta descriptions

The audit found no page without a description and none using a template fallback. The classes it did find are fixed at the source:

  • Every language home read libtmux for TypeScript, version latest., naming a build identity and no task. portHomeDescription says what a reader does with the port and which sections the home leads to.
  • Members sharing one summary ("The pane that was read.") gave hundreds of pages one description, and a symbol without a summary read <name> API documentation.. symbolDescription leads with the qualified name, stays within 160 characters at a word boundary, and names the kind and reference when there is no summary. It serves the core reference, the Workspace and MCP API pages and the MCP object pages.
  • The same page in several languages shares a description by design, so the audit no longer calls that a duplicate: of 1,398 pages it flagged, 871 are shared within a port or across different pages.

Head audit

site/scripts/audit-head.mjs reads the head of every page in the advertised sitemaps, a built tree or a URL list, and reports title, description, canonical, robots, og:*, twitter:*, icon, manifest and sitemap links, hreflang alternates, whether each asset answers 200, whether the icon set is the page's own port and product, and whether a sitemap lists the page. It is not a gate: no test loop or CI job runs it. CONTRIBUTING.md documents it under "Auditing page heads".

$ node site/scripts/audit-head.mjs --out /tmp/head-audit
$ node site/scripts/audit-head.mjs --dist _site --out /tmp/head-audit

The first reads production from the sitemaps robots.txt names; the second reads an assembled tree and also finds pages that exist and no sitemap lists. It writes head-audit.json and head-audit.md; --format json,md,html adds a single static table of every page, and --include, --exclude and --sample narrow a run. Production safety: GET and HEAD only, a User-Agent naming this repository, at most --concurrency requests in flight (4 by default), a gap between starts, retry with backoff on 429 and 5xx, and a page is read only to its </head>. It reads the document head, not the body, because the workspace previews put inline SVG <title> elements in the body.

site/test/head-audit.test.ts plants one bad head per rule and fails if a rule is added without one; it also renders Seo.astro for every section of the title table and checks the audit finds nothing to say about it.

What it found on production (12,163 pages from the sitemaps, 2026-11-01):

Rule Pages Examples
social-image-format (SVG og:image) 8,492 /en/tmux/, /en/tmux/concepts/
og-site-name (not libtmux.org) 3,657 /en/, /en/csharp/latest/concepts/
title-lacks-context (no language or product) 2,963 /en/csharp/latest/concepts/queries/, /en/csharp/latest/mcp/tools/call_read_tools_batch/
title-over-budget (over 60) 1,610 /en/tmux/latest/reference/c-define-cmd-list-windows-c-list_windows_with_session_template/, /en/csharp/latest/mcp/reference/libtmux-mcp-channelwaitresult-elapsedseconds/
description-duplicate 1,398 (871 after exempting one page in several languages) /en/csharp/latest/mcp/reference/libtmux-mcp-captureresult-paneid/, /en/tmux/latest/reference/c-variable-shell_command/
title-slug-case (capabilities | libtmux-ts) 410 /en/csharp/latest/mcp/resources/tmux_capabilities/, /en/py/latest/mcp/prompts/build_dev_workspace/
title-duplicate 91 /en/csharp/latest/guides/ and /en/csharp/latest/workspace/guides/, /en/tmux/latest/reference/c-enum-client-c-.../
noindex-in-sitemap 38 /en/reference/, /en/reference/symbols/r/, /en/rs/latest/concepts/standard-library-core/
redirect-stub, title-generic, redirect-listed (a stub titled the documentation, listed) 9 each /en/csharp/latest/examples/workspace-from-file/, /en/cxx/latest/examples/workspace-from-file/
sitemap-url-error and http-status (listed, answers 403) 5 each /en/go/latest/mcp/reference/mcp-materializeminimalconfig/, /en/go/latest/mcp/reference/mcp-rundefaultminimal/

No page tripped brand-mismatch, asset-unreachable, description-missing, description-generic, og-image-missing, canonical-missing, lang-mismatch or any hreflang-* rule. The manifest-missing rule fired on all 8,492 tmux pages and is now reported as the tmux icon set instead, since that section has no manifest artwork.

Sitemaps

Root cause. The shell's sitemap is @astrojs/sitemap in the root shell build, so it lists only the pages that build renders, and it filters by URL alone. Each port tree is published by that port's own docs workflow from a separate per-port build (LIBTMUX_DOCS_PORT set), and that build registers no sitemap. A page only a port build renders was therefore in no sitemap: every language home (/en/<port>/latest/), the core reference tree (.../reference/...), the port's api/ redirect, and a native Python tree, which is copied in after the Astro build. en/ts/latest/mcp/resources/capabilities/ is present because the product pages are also rendered by the root build. The three pages named in the request (cxx, lua and elixir reference/libtmux-server) are core reference pages: they are also absent on purpose, because ApiReference.astro says noindex, nofollow and a sitemap does not list a page that says so. Separately, the filter knew nothing about a page's own head, so 38 pages that say noindex or redirect elsewhere were listed.

The fix:

  • headVerdict reads a page's head and keeps out noindex pages, meta-refresh stubs and pages whose canonical is another URL. The shell's @astrojs/sitemap filter asks it through the pageHeads build hook, which runs first.
  • writePortSitemap writes sitemap-0.xml and sitemap-index.xml into each default port tree from the finished files, Astro and native pages alike; build-site.sh runs it after the native shell is injected, so the port's publisher uploads it with the tree, and a tree over the protocol's 50,000-URL file fails the build instead of dropping pages.
  • The English index names every port's default-tree sitemap-0.xml (customSitemaps, from LIBTMUX_DOCS_PORT_DEFAULTS). Port trees are English only, so the Japanese index does not.
  • Every page names the sitemap that lists it with <link rel="sitemap">: its port tree's own (portSitemapUrl) for a port page, the locale's index for a shared page, nothing in a PR preview. The native branding pass adds the same link to Sphinx pages.
  • Two head changes the sitemap work exposed. A port tree's copy of a shared meta/ page (ai-policy, intersphinx, linking, third-party-notices, once per port) named itself canonical and said index; the English static pages under /ja/ did the same. Both now name the root or English page and say noindex, follow, as the support, parity and translations copies and the placeholders already did. Seo.astro reads the page's locale tree from the build (buildLocale), because most static pages never pass a locale prop.
  • The build-site.sh change passes the port's default version to the native branding pass through an argument array that stays empty in a preview, which also clears the ShellCheck SC2046 warning (an unquoted command substitution) that failed the previous CI run.

Evidence from a local assembly of the previous revision of this branch (build-site.sh --ports ts --versions latest --skip-refs --skip-pagefind: the en and ja shells and the TypeScript tree) audited with --dist. It has not been repeated on this revision, because site builds were not run for the rebuild:

  • The English shell sitemap went from 12,161 URLs on production to 12,139. It dropped 38 (nine redirect stubs, the reference hub and its 27 letter pages, one more noindex concept page) and gained the 16 /core/ pages Read each port's link syntax in the capability directory #232 adds. Its index named the shell's sitemap-0.xml and each port's latest/sitemap-0.xml.
  • The TypeScript tree's sitemap listed 212 pages: the 211 the shell listed plus the language home /en/ts/latest/, which no sitemap listed. 882 noindex pages, the core reference tree among them, stayed out.
  • The rebuilt Japanese tree listed /ja/ and /ja/tmux/concepts/ and nothing else, and every other page under /ja/ said noindex with the English canonical.
  • The audit found no noindex-in-sitemap or redirect-listed page in any of the three trees, and no not-in-sitemap page in the English shell or the TypeScript tree. It found five in the Japanese tree before the Japanese fix, and none after.

Graphics

Every port, product and section already advertises its own port's brand assets: the audit found no page with another port's or product's icon set, no icon, manifest or social image that failed to answer 200, and no page without an og:image or twitter:image. Nothing in BrandIcons.astro changed, and no page's <link rel="icon"> was touched. The audit reports one thing: the tmux section (most of the sitemap) names one SVG, tmux-logomark.svg, as its icon and as og:image and twitter:image, and has no manifest, apple-touch icon or favicon.ico. Facebook, X and LinkedIn do not draw an SVG, so a shared tmux link carries no image. The audit's social-image-format rule counts these pages. #244 replaced the language library cards and left the tmux section as it was, so this PR does not add card artwork (see the decisions below).

Infra changes for root (not applied; root owns cloud)

  1. /sitemap.xml and /sitemap-index.xml answer 403 today, and some crawlers and tools guess them. Add a rule to the viewer-request function in infra/cloudfront-function.js, beside rule 0, that answers both with a 301 to /en/sitemap-index.xml (the same cache-control: public, max-age=86400 the other permanent redirects use). Re-check the 10 KB quota with wc -c, and extend site/test/edge-redirects.test.ts and scripts/check-edge-extensions.mjs with the new paths. Bing and Google read the Sitemap: lines in robots.txt, so this only serves tools that probe the conventional path.
  2. /favicon.ico answers 403. It is a fallback and not a fix for any page. The HTML Standard fetches /favicon.ico only "in the absence of a link with the icon keyword, for Document objects whose URL's scheme is an HTTP(S) scheme", and where icon links exist the user agent "must select the most appropriate icon according to the type, media, and sizes attributes" (link type icon). Every HTML page here already carries icon links, so the root file would reach only documents without them (the .md twins, JSON, raw images) and tools that ignore <link>. If wanted, serve it by a rewrite in the same function (request.uri = '/en/favicon.ico', which already exists as site/public/favicon.ico and answers 200 under /en/) so no new object is published and no per-port favicon is shadowed.
  3. Optional: one top-level sitemap. The sitemap protocol forbids an index that lists other indexes (sitemaps.org), so a single /sitemap-index.xml would have to list the sitemap-0.xml files of both locales and of every port, and track their names. robots.txt already names /en/sitemap-index.xml and /ja/sitemap-index.xml, so this only helps a person who wants one Search Console submission. Low priority.
  4. Rollout order for the port sitemaps. The English index names each port's default-tree sitemap-0.xml, and each port's own docs workflow publishes that file with its tree. Until a port republishes with this docs revision, its entry answers 403 and crawlers skip it. Dispatch publish.yml for all ports at their default version after this merges, and the audit's sitemap-unreachable rule lists any that are still missing.

Decisions for Tony

  1. The site name ends every title, instead of libtmux-ts. The tail is libtmux.org and the language is spelled in the context (TypeScript MCP resource), so a tab says where it is without decoding ts. Alternative: keep each port's project name as the tail (... | libtmux-ts), which leaves 17 distinct brand strings and no language word. Implemented: libtmux.org. The language home title stays libtmux-ts: TypeScript-based tmux client; libtmux-rs: Rust-based tmux client is unchanged.
  2. Core pages carry no product word. Rust guide is the core library; Rust MCP tool and Rust Workspace CLI name their product. Alternative: say Core (Rust Core guide) to match the picker's "Core Library". Implemented: no word.
  3. 60 characters, then "API reference" becomes "API". A title gives up the site name first and then the word "reference"; 648 production pages stay over budget because the identifier alone is long. Alternative: a hard 70 with no shortening. Implemented: the order above.
  4. Google's one favicon per hostname. Google Search supports "one favicon per site, where a site is defined by the hostname", read from the home page, and "a subdirectory-level home page" is not supported (favicon in Search). https://libtmux.org/ answers 302 to /en/, which advertises /en/brand/python/library/favicon.ico, so every libtmux.org result in Google shows the Python library icon. Options: a neutral libtmux mark on /en/ and /ja/, or keep Python's. Not changed here, and no per-port favicon wiring was touched.
  5. tmux link cards. The tmux section needs a raster og:image and twitter:image; its artwork is the SVG mark only, and Show native library queries in port sharing previews #244 covered the language library cards. Decide who supplies the tmux card; the audit counts the pages until it exists.
  6. Core reference pages stay noindex (ApiReference.astro), so they are in no sitemap, including the three the request named (cxx, lua and elixir reference/libtmux-server). That is consistent: a sitemap does not list a page that says noindex. If the reference is promoted to indexable, the port tree sitemaps list it with no further change.
  7. /en/search/ is indexable and listed. An internal search page is usually kept out of an index. One line (noindex on search.astro) removes it from the sitemap too. Not changed.
  8. Drop the shell's listing of port pages after the ports republish. The shell's sitemap still lists the port pages it renders, now beside each port's own sitemap, so crawlers see both and the five 403 URLs above (pages the shell renders and a port's published tree lacks) stay until then. Filtering /<locale>/<port>/ out of the shell's list is one line; doing it before every port has published its sitemap would hide the pages meanwhile.
  9. No hreflang beyond today's. Seo.astro already emits en, ja and x-default alternates where a real translation exists (/en/, /ja/, /en/tmux/concepts/, /ja/tmux/concepts/), and the audit found no page with a translation and no alternates. A page with no translation correctly has none: an alternate that 404s is worse than none.
  10. Static pages under /ja/ and meta/ copies in port trees changed their robots and canonical. Both said index under a self canonical while holding English content or a duplicate; both now say noindex, follow with the English or root canonical, like a placeholder. Alternative: leave them and list them in the sitemaps, which would list the duplicates once per port and the English pages under /ja/. Implemented: noindex.
  11. Python's native pages join its sitemap only when the Python docs workflow republishes. They are copied in after the Astro build, so gen-port-sitemap.mjs sees them in a real assembly; this PR tests that path on a fixture, not on a Sphinx build.

What ran

On the rebuilt branch, with two vitest workers and every command under a memory cap:

  • vitest run over the suites the commits add or change (document-title, branding, product-copy, head-audit, sitemap-heads, sitemap-workspace, exports, product-docs) and the title, head, sitemap, description and locale suites found by searching site/test for sitemap, <title, og:title, pageTitle, Seo.astro, buildLocale and the title helpers (including three *.outer.test.ts files): 31 files passed, 2 skipped (assembled-tree suites), 1 failed. The failure is two product-docs.test.ts tests that stage native guides (ruby: stage native guide README.md); they fail the same way on unmodified main, because the libtmux-raku checkout on the machine lacks the revision stage-port-docs.mjs --integrated needs. 829 tests passed, 170 skipped.
  • astro check: 0 errors, 0 warnings, 45 hints, none in code this PR adds.
  • pnpm -C site run lint: exit 0 with 13 warnings, none in a changed file. oxlint scripts site/scripts: exit 0, no finding in a changed file.
  • shellcheck -x -S warning scripts/*.sh, the command test-all.sh runs: clean. Putting the unquoted $(...) back into build-site.sh makes it report SC2046 and exit 1.
  • Each new or changed check was shown failing on a deliberate break, then restored: the title budget, the C declaration kind, the symbol-name lead, the native sitemap link, the site name (product-copy), the meta/ site-level rule, the locale tree read from a prop, the noindex verdict, customSitemaps in the config, the list drain in the audit, the noindex sibling in the hreflang rule, the 50,000-URL limit, and the sitemap link Seo.astro writes. The last one had no test before the rebuild; head-audit.test.ts now renders Seo.astro for a port page, a shared page and a preview and reads the link.
  • The exports.test.ts sitemap tests, against a minimal published tree built for the run (the real tree needs a full assembly): they pass with a sitemap for every port, with and without a release tag as a port's default version, and fail with one port's sitemap file missing or with the index naming latest for a port whose default is a tag. The test now reads each port's default version from the tree's versions.json instead of assuming latest.
  • Evidence from the previous revision of this branch, not repeated: a production run of the audit (12,163 pages, 2026-11-01, read-only, concurrency 4) and the local partial assembly described under "Sitemaps".

Not run: site builds and assemblies (build-site.sh, astro build), the outer loop (pnpm test, Chromium and check-dev.mjs), the assembled-tree suites against a real assembly (product-docs.test.ts asserts product URLs are in the shell sitemap; the head filter should keep all of them, but that has not run against a real assembly), a Sphinx (Python) native tree, and any port repository's docs workflow, so a port's sitemap-0.xml has not been through reusable-deploy.yml.

@tony

tony commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

The test check fails in its first stage: ./scripts/test-all.sh --preview pr-245 stops at "shell scripts" on ShellCheck SC2046, scripts/build-site.sh line 1103 ($([ "$preview_build" -eq 0 ] && printf '%s' "$default_version") needs quoting), so the run on the current head, from 2026-11-02 18:43 CST, never reached the unit tests or later stages. The PR is a draft, conflicts with main and has no review. None of its changes are live: /en/ts/latest/mcp/resources/capabilities/ still titles capabilities | libtmux-ts, and /en/tmux/ still points og:image at an SVG. The branch also carries a commit its title and description omit, docs(site[tmux]) Drop the tmux 3.2a documentation tree, which a reviewer of the head-audit work would also be approving (see #241). This PR, #244 (social cards) and #104 (sitemap policy) together cover the maintainer's 2026-11-01 request for normalized titles, an on-demand audit of meta and Open Graph tags, and port pages that advertise their own icons and sitemaps. Next action: quote the substitution, rebase onto main, rerun so the later stages run for the first time on this PR, and consider moving the 3.2a commit to its own PR.

@tony
tony force-pushed the feat/title-meta-audit-20261101 branch from c4b4817 to e6dc630 Compare November 22, 2026 01:14
tony added 20 commits November 22, 2026 04:29
why: A tab said `capabilities | libtmux-ts` for a TypeScript MCP
resource: no language word, no product, no kind. Sibling pages shared
titles (`Guides | libtmux-java` for core, Workspace and MCP alike), the
MCP indexes capitalised "Tools" and "topics" differently, and each of
tmux, ports and native pages built its tab by its own rule. The card
tags repeated the tab, and og:site_name was the project name on port
pages and `libtmux.org` on tmux pages.

what:
- documentationTitle returns the tab, the card title and the context
  from one scheme: the page's own name, then `<Language> <Product>
  <kind>` (`TypeScript MCP resource`, `Rust guide`, `tmux manual`),
  then `libtmux.org`. The context is left out when the name already
  says it, and a non-default version is named in it.
- A title that would pass 60 characters, the width a result or a tab
  keeps, drops the site name first and keeps the context. Language
  homes keep the title portHomeTitle sets.
- og:title and twitter:title drop the site name, which og:site_name
  already shows. og:site_name and the WebSite name are `libtmux.org`
  everywhere.
- The native branding pass applies the same scheme to the decoded
  title and escapes the result.
- DOC_PRODUCTS gains the short product label a title uses.
why: Nobody could see what a page tells a tab, a crawler or a link card
without opening it. The inline SVG titles in the workspace previews make
a text search for `<title>` misleading, and no check compared a page's
head with the port and product it documents.

what:
- site/scripts/audit-head.mjs reads the head of each page in the
  advertised sitemaps, a built tree or a URL list, and writes JSON, a
  Markdown report and an optional single-table HTML page. It requests
  with a named User-Agent, bounded concurrency and a gap between
  requests, retries 429 and 5xx with backoff, and stops reading a page
  at `</head>`.
- audit-head-rules.mjs holds the snag rules: missing, generic,
  slug-cased, context-less, over-budget and duplicate titles;
  missing, generic and duplicate descriptions; canonical, robots and
  social-tag disagreements; unreachable icon, manifest and social
  images; brand assets of another port or product; hreflang gaps; and
  sitemap membership.
- site/test/head-audit.test.ts plants one bad head per rule, so a rule
  that stops firing fails, and checks that Seo.astro's output passes.
why: The shell's sitemap lists only the pages the shell build renders,
and each port's own docs workflow publishes the rest of its tree. The
language homes, anything only a port build renders, and a native Python
tree were in no sitemap, and the shell listed redirect stubs
(`the documentation`) that tell crawlers to go elsewhere. A page's head
already says whether it is indexable; the sitemaps did not read it.

what:
- headVerdict reads a page's head and keeps out noindex pages, meta
  refresh stubs and pages whose canonical is another URL.
- The shell's sitemap filter asks it, through a build hook that runs
  before @astrojs/sitemap.
- gen-port-sitemap.mjs writes sitemap-0.xml and sitemap-index.xml into
  a default port tree from the finished files, Astro and native pages
  alike, and fails past the protocol's file limit instead of dropping
  pages. build-site.sh runs it after the native shell is injected.
- The English index names each port tree's sitemap through
  customSitemaps. Port trees are English only, so the other locale's
  index does not.
why: Every language home described itself as `libtmux for TypeScript,
version latest.`: the same sentence with a language swapped, naming a
build identity and no task, and rewritten by each release.

what:
- portHomeDescription says what a reader does with the port (control
  tmux servers, sessions, windows and panes from the language) and which
  sections the home leads to, named by the same repository name the home
  title uses.
why: Port pages advertised a port's logos and manifest and no sitemap.
A crawler that lands on a port page, or reads a page it found by a link,
had only the origin's robots.txt to find the XML that lists it.

what:
- Seo.astro adds `<link rel="sitemap">` to every page: the port tree's
  own sitemap index for a port page, the locale's index for a shared
  page, and nothing in a preview, which builds none.
- The native branding pass adds the same link to Sphinx pages and
  replaces one it finds, so a rerun changes nothing; build-site.sh gives
  it the port's default version through an argument array that stays
  empty in a preview, so no command substitution is left unquoted
  (ShellCheck SC2046).
- portSitemapUrl in ports.ts holds the path, beside portHomeUrl.
- The audit reads the link, checks that it answers, and reports a page
  without one.
- A test renders Seo.astro for a port page, a shared page and a preview
  and reads the link each writes.
why: The sitemap section of the architecture notes described a rule the
build no longer follows, and nothing said how to run the head audit or
which scheme names a page.

what:
- architecture.md describes sitemaps that follow each page's head, the
  port tree sitemaps and the one title scheme.
- CONTRIBUTING.md says how to run the audit against production or a
  built tree, and what it requests.
why: The first run against production flagged one page shared by ten
languages as ten duplicate descriptions, every tmux page for a manifest
the section has no artwork for, and nine thousand API summaries under
fifty characters. None of them is a snag a page can fix.

what:
- A description shared by the same page in different ports is not a
  duplicate; one shared within a port, or by two different pages, is.
- The tmux section's missing manifest is reported through its icon set,
  not as a snag.
- The short-description floor is 30 characters.
- The sitemap-unreachable rule is a function the tests call.
why: A third of the C# MCP and Workspace API pages, named by long
qualified identifiers, would pass 60 characters with the context
`C# MCP API reference` and lose its last words in a result. The name is
what a reader scans for and the context is what tells languages apart,
so neither should be cut.

what:
- A title that does not fit first gives up the site name, then the word
  "reference" (`LibTmux.Mcp.BoundedText.ToDisplayString | C# MCP API`).
  A name no context can rescue keeps its whole context.
- The card title follows the tab title, so the two never disagree.
why: Members that share a summary ("The pane that was read.") gave
hundreds of pages one description in a result, and a symbol with no
summary read `<name> API documentation.`. Production shows the first as
the largest class of duplicate descriptions after the same page in
several languages.

what:
- symbolDescription puts the qualified name before the summary, keeps
  the result within 160 characters at a word boundary, and names the
  kind and reference when there is no summary.
- The core reference, the Workspace and MCP API pages and the MCP
  object pages use it.
…cker

why: astro check read the audit tests' calls into the .mjs rules as
implicit any, and the native branding pass's optional version as
required.

what:
- JSDoc types on the audit's functions and on nativeBrandHead's options.
why: The title scheme now shortens `API reference` after dropping the site name, and the architecture notes named only the first step.

what:
- architecture.md lists the order a long title gives things up.
why: A tmux function and a struct, or a function and a variable, of one
name had one title (`args_parse | Reference | tmux`). Fifty-seven
reference pages shared a title with another page.

what:
- The kind in a tmux C reference title comes from the page's slug:
  `args_parse | tmux C function | libtmux.org`, `... | tmux C struct`.
why: The budget comments claimed a pixel width and a character count that the cited guides do not state.

what:
- TITLE_BUDGET and DESCRIPTION_BUDGET quote the guides' wording, and call 60 and 160 characters working budgets.
why: Port trees carry copies of the shared `meta/` pages (AI policy,
intersphinx, linking, third-party notices). The support, parity and
translations copies already name the root page and say noindex; these
five were indexable under a self canonical, once per port. A sitemap that
lists every indexable page of a port tree would have listed each of them
sixteen times.

what:
- Seo.astro treats a `meta/` page inside a port tree as the site's: the
  canonical is the root page and the robots tag is `noindex, follow`.
why: `--list` printed the pages and called process.exit, which cut a
long list off at the pipe's buffer: 814 of 27,547 pages reached `wc`.

what:
- The list is written and drained before the process exits.
- A test lists a 2,500-page tree through a pipe, and failed with 2,454
  pages against the old behavior.
why: Auditing an assembled tree found English pages under `/ja/`
(`mcp/tools`, `meta/parity`, `meta/support`, `meta/translations`,
`search`) that said `index, follow` under a self canonical, with no
hreflang. They duplicate the English pages, and no sitemap listed them,
so the head and the sitemap disagreed. A placeholder already says
noindex and names the English page; these static pages did not.

what:
- Seo.astro treats a page in a non-default locale tree that no
  translation backs (`locales` does not name its locale) as the English
  page: the canonical is the English URL and the robots tag is
  `noindex, follow`. A translated page passes `locales` and is unchanged.
- The audit does not ask a page to point at a translation that says
  noindex, reports a language or brand mismatch on a noindex page as
  information, and skips `demo` trees, which robots.txt disallows.
why: The untranslated-page rule read the `locale` prop, which most
static pages never pass: they render as `en` in the Japanese build, so
`/ja/mcp/tools/`, `meta/parity`, `meta/support` and `search` stayed
indexable under a self canonical. A built Japanese tree showed it.

what:
- Seo.astro asks buildLocale() which tree the page is built into.
- A Japanese build now lists exactly the two pages that carry a
  translation and says noindex, with the English canonical, on the rest.
…h index

why: The index tests required every sitemap the English index names to
exist in the production root render, which has no port trees, so the
sitemaps the index now names for each port tree would fail them in a
preview and in a full assembly's shell-only render.

what:
- The shell's sitemaps must exist in the production render; the index
  must name every port's default-tree `sitemap-0.xml`, with the default
  version read from the assembled `versions.json` (a port's newest
  release tag, or `latest` while it has none), and a non-preview
  assembly must have written each one.
- The preview and demo exclusion reads the port sitemaps that exist.
- The product URL check reads the files that exist.
- Run against a minimal tree, the new test passed with every port sitemap
  present, with and without a release tag as a port's default, and failed
  with the TypeScript one removed or with the index naming `latest` for a
  port whose default is a tag.
why: The browser checks still asserted the old "<name> | libtmux-<port>"
titles, so CI failed once pages took the new scheme: name first, then
language and kind, then the site while the title fits its 60-character
budget.
what:
- check-dev.mjs: the three Java symbol pages expect their
  documentationTitle values; the two longer names drop the site suffix to
  fit the budget
- check-navigation.mjs: the F# reference expects "F# API reference |
  libtmux.org"
why: The guide redirect check still asserted "Getting started |
libtmux-ruby". CI reached it only after the F# assertion before it was
fixed, and the page now reads "Getting started | Ruby guide | libtmux.org".
what:
- check-navigation.mjs: checkGuideRedirect expects the name | language
  kind | site title
@tony
tony force-pushed the feat/title-meta-audit-20261101 branch from f3c855e to 6662558 Compare November 22, 2026 10:32
tony added 3 commits November 22, 2026 05:03
why: Only the example pages whose excerpts quote a program, such as
Go's, read "Complete program" in the frame header. The Python, Ruby,
Lua, Rust, Java, C#, C++, Julia and PowerShell pages show the file name
alone, so a reader cannot tell the program from its build file.

what:
- Treat a titled block on an example page as the complete program when
  it is a source file, as an excerpt-quoted block already is.
- Leave build, manifest and data files (Gemfile, Cargo.toml,
  build.gradle.kts, a .csproj) unlabelled, as the attach guides do.
- Keep concept pages and guides as they are: their titled blocks are
  steps, and the attach guides set their own role.
- Test nine example pages for the program label and its absence on the
  build file beside it.
why: The prompt's code is 13px, but its rows are 24.5px apart. The
inline `code` carries line-height 1.7 (22.1px), yet it sits in the `pre`'s
inherited 16px/24px line box, and that box sets the pitch. Record 0032
gives code blocks a line height of 1.7.

what:
- Give `.lm-agent-prompt__code pre` the same 13px size and 1.7 line
  height as its `code`, so a row is 22.1px.
- Assert the `pre` rule beside the existing `code` rule.
why: A capped frame's bar reads "24 of 80 lines" and kept that text
after "Show all" opened the frame, hiding the count only through the
`hidden` attribute. The bar should say what the frame shows now.

what:
- Write "80 lines" into the bar's count when the frame opens, and
  "24 of 80 lines" again when it closes, instead of toggling `hidden`.
- Drop the `.cap-count[hidden]` rule, which nothing sets any more.
- Assert the bar's text in the open and closed states.
tony added 7 commits November 22, 2026 08:27
why: Every file that links API prose must say what it does with an
address outside the site, and the new /demo/corner-badges/ page builds an
index and passes it to ApiEntry without an entry, which failed CI.
what:
- api-prose-fields.test.ts: register src/pages/demo/corner-badges.astro
why: The panel workspace trial drew its panels once and could not
rearrange them, so a reader could not judge the layout in use. Its
splitters reported no value to assistive technology, a closed panel was
gone, and the layout was written but never read back.

what:
- Add moveLeaf, swapLeaves, nudgeLeaf, resizePair and pairPercent to the
  layout tree. They are pure, a moved panel keeps its share of the row,
  and a run of 400 random arrow moves must never lose or repeat a panel.
- Add panel-dock.ts for every workspace to share: a header drag outlines
  the half of a panel it would dock to, Alt with an arrow key moves a
  focused header, and a splitter is a focusable separator that arrow
  keys, Home and End resize and that reports aria-valuenow.
- Keep a closed panel with its tabs, list it under Closed panels and
  reopen it beside the active panel.
- Start the trial from its last session when the address names no
  template or locator. Storage goes through panelStore, which treats
  blocked, full or foreign storage as absent.
- Mount the trial once. The router fires astro:page-load on the first
  load too, and an empty dataset value is falsy, so the old guard never
  held and every handler ran twice.
- Draw the active header with the site's current-row tint, with a
  forced-colours rule, and ring a focused header inside its edge.
why: Dropping a panel on the bottom, top, left or right half of another
panel gave the dropped panel its old share of the layout, so a panel
that was a quarter of a row took a quarter of the target's cell and the
outlined half was a promise the layout did not keep.

what:
- Drop the share adjustment from moveLeaf. The dropped panel and its
  target now split the target's cell 50/50 on every side, and the cell
  the panel left goes to its former neighbours.
- Replace the test that held the old share with tests that read each
  panel's area of the layout for all four sides, at the top level and
  inside a column.
why: A panel carried up to 24px of padding, a 12px header inset and a
body that ran to 32px at the bottom, which left a document too little
room in a panel and a wide gap above its first line. A header also cut
a readout to 40% of its width while the header had room, so a symbol
name showed an ellipsis beside empty space.

what:
- Give every panel surface the site's 8px space token for padding: the
  header, body, tool rail, cards, sheets, popovers, notes and command
  bar. The sheet bar's negative margin follows.
- Let a header's title take the width of its text and give way only when
  the title alone would crowd out the close button. The readout beside
  it takes the room that is left and truncates only when there is none.
- Test the padding of each surface and the flex and cap of the title and
  readout from the stylesheet, with a break for each that the test
  catches.
why: The owner wants to try the panel workspace on real pages, not on
the trial's stand-in documents or on a twin page written for each
route. A client-side mode needs no page of its own, so a build writes
the same pages as before and a reader who never opts in sees no change.

what:
- Turn the mode on with ?panels=1 on any page and off with ?panels=0 or
  the workspace's Exit panels button. The choice is kept in
  localStorage, read in <head> before the body is parsed, and read again
  after each router swap, so the mode follows the reader across pages.
  With storage blocked, ?panels=1 lasts for that page and stays in the
  address.
- Lift the page's main#content into the main panel without redrawing it,
  so the page keeps its scroll, listeners and focus. A link to a page of
  the site fetches that page and lifts its article into the panel; Shift
  with a click opens a panel of its own; a fragment scrolls the panel
  that holds it. A page that does not load leaves the panel as it was.
- Read the linked panels back from the page's markup: the rows of an API
  symbol page's "In other ports" table, else the language picker's
  links. A linked panel opens its page in place.
- Keep the arrangement of columns, rows, splits, sizes and open panels in
  localStorage inside try/catch, and forget it from Reset layout.
- Load the workspace's code and styles only when the mode is on. The
  styles go in as text, which a router swap does not drop with the head.
  Rules in global.css behind the root attribute keep the page's own body
  out of sight until the workspace draws.
- Strip the padding a page's own columns set from a lifted article, put
  a touch-target hit area on the header, buttons and splitters on a
  coarse pointer, and draw splitters and the Panels list in forced
  colours.
- Test the toggle, its persistence, the reset, the layout memory, the
  link policy, the linked-panel readers and the mode-off page, with a
  break for each that the tests catch.
why: The mode has no link on the site, so a contributor learns how to
turn it on, where it keeps its choice and layout, and which tests hold
its rules only from the contributing guide.

what:
- Add a Panel mode section: ?panels=1 and ?panels=0, the Exit button,
  the two localStorage keys, how a link opens a page in a panel and where
  the linked panels come from.
- Name the files that own the choice and the stylesheet rules, and the
  tests that hold them, with the command that serves one port.
why: Whole programs on example pages now carry a "Complete program" role
label, so main.go's frame is named "main.go Complete program". The check
looked the figure up by the exact name "main.go", found nothing, and
hashed an empty list, failing CI.
what:
- check-clipboard.mjs: find the frame whose caption title is the file
  name, and assert exactly one carries it
@tony
tony deployed to docs-preview November 22, 2026 20:15 — with GitHub Actions Active
@tony
tony marked this pull request as ready for review November 22, 2026 20:27
@tony
tony merged commit 5486d9a into main Nov 22, 2026
3 checks passed
This was referenced Nov 22, 2026
@tony
tony deployed to docs-preview-cleanup November 22, 2026 20:51 — with GitHub Actions Active

This branch was successfully deployed

2 active deployments
docs-preview-cleanup — 22b1fc96 Deployed Nov 22, 2026 by tony via cleanup #270
docs-preview — 22b1fc96 Deployed Nov 22, 2026 by tony via publish-preview / publish #1541
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant