Skip to content

Stop repeating the site name in the root page title - #4982

Merged
reakaleek merged 5 commits into
mainfrom
docs-root-title-repeat-efded2a6
Nov 20, 2026
Merged

reakaleek merged 5 commits into
mainfrom
docs-root-title-repeat-efded2a6

Conversation

@reakaleek

@reakaleek reakaleek commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

The HTML title of a docset's root page no longer repeats the site name. On elastic.co/docs, the title changes from Elastic Docs | Elastic Docs to Elastic Docs.

Affects: Authoring, Assembler builds, Isolated builds

Prompt summary: The author asks why the root of elastic.co/docs has the title Elastic Docs | Elastic Docs, and then asks for a fix.

Why

PageTitleResolver always builds the title as {meta_title or H1} | {site name}. The site name is the docset's root navigation title. The root page of docs-content has the H1 Elastic Docs, and the navigation title is also Elastic Docs, so the two halves are the same string. Browser tabs, search results and link previews all show the doubled title.

What

Title suffix

PageTitleResolver.Resolve leaves off | {site name} when the page title equals the site name, ignoring case. All other pages keep the suffix. The change applies to <title> and og:title, which both read the same value.

Tests and journeys

Three tests in PageTitleTests expected the doubled form, because each fixture's only page is also the docset root. They now expect the plain title. A new test covers a title that differs from the site name only in case. The meta_title test still covers a title that differs from the site name. landing/home.journey expects docs-builder. navigation/synth/main-paths.journey checks the home page's first link instead of its title, because it runs against prod and the deployed title changes only when the site is rebuilt. The Synthetics navigation-test.journey.ts accepts both Elastic Docs and Elastic Docs | Elastic Docs on the home page, because its monitors run against sites that are not rebuilt yet.

Authoring docs

docs/syntax/titles.md and docs/syntax/frontmatter.md explain that the builder leaves off the site name when the title matches it.

Verify

dotnet test --project tests/Elastic.Markdown.Tests --treenode-filter "/*/*/PageTitleTests/*"
mise run serve
# http://localhost:3000/         -> <title>docs-builder</title>
# http://localhost:3000/syntax/  -> <title>Syntax guide | docs-builder</title>
mise run journeys:local --only landing/home
mise run journeys:synth prod --only navigation/main-paths

Check on the preview

  • Root page — the tab title reads docs-builder, with no repeated suffix.
  • Syntax guide — control page: the title stays Syntax guide | docs-builder.

🤖 Generated with Claude Code

The root page of elastic.co/docs rendered "Elastic Docs | Elastic Docs" because its H1 equals the docset's navigation title. `PageTitleResolver` now leaves the suffix off when the two match.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@reakaleek
reakaleek requested a review from a team as a code owner November 20, 2026 09:52
@reakaleek reakaleek added the bug label Nov 20, 2026
@reakaleek
reakaleek requested a review from akira28 November 20, 2026 09:52
reakaleek and others added 3 commits November 20, 2026 10:57
…view by @infra-vault-gh-plugin-prod)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…vault-gh-plugin-prod)

The isolated home journey expects the new single title. The prod monitor checks the home page's first link instead, because the deployed title changes only when the site is rebuilt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ng (per review by @infra-vault-gh-plugin-prod)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
wait --load networkidle
expect title "Elastic Docs | Elastic Docs"
# The home page title changes from "Elastic Docs | Elastic Docs" to "Elastic Docs" when the site is rebuilt, so check its first link instead.
expect visible find role link --name "Elastic Fundamentals"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: P3 (Low)

Checking the link that the next step already clicks removes the assembled home page’s title check entirely. The smoke journey will now pass even if /docs/ ships an empty or unrelated title. Match either the old or the new title during rollout rather than dropping the assertion.

Generated by Libra. React with 👍 or 👎 to give feedback on this comment.

@github-actions

Copy link
Copy Markdown
Contributor

The preview check failed because the root page now has the title `Elastic Docs`. The journey also runs as a monitor against prod, staging and edge, which keep the old title until each site is rebuilt, so the anchored regex accepts both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@reakaleek
reakaleek enabled auto-merge (squash) November 20, 2026 10:16
@reakaleek
reakaleek merged commit 8cf95d3 into main Nov 20, 2026
44 checks passed
@reakaleek
reakaleek deleted the docs-root-title-repeat-efded2a6 branch November 20, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants