Skip to content

ButterIX v1 is out: versions, multiple languages, Ask AI, and a per-site MCP server, all built in. →

SEO

Every page is complete HTML generated at build time, with canonical, hreflang, Open Graph, and structured data; the sitemap, robots.txt, and redirects are generated automatically.

Static HTML

At build time ButterIX uses React server rendering to output complete HTML for every page, without relying on client-side JavaScript to render content. Search engine crawlers, social link previews, and AI crawlers get everything readers see — body text, code examples, and API parameter tables included.

Navigation between pages happens without a full reload via a tiny client script, and links are prefetched with Speculation Rules, but that's only an experience enhancement: with JavaScript disabled, the site is still fully browsable.

The head of every page

Taking this page as an example, the builder outputs:

<head> (excerpt)
<title>SEO · ButterIX</title>
<meta name="description" content="SEO in ButterIX — static HTML, title templates and meta…">
<link rel="canonical" href="https://acme-payments-sites.butterix.com/guides/features/seo">
<link rel="alternate" hreflang="zh" href="https://acme-payments-sites.butterix.com/guides/features/seo">
<link rel="alternate" hreflang="x-default" href="https://acme-payments-sites.butterix.com/guides/features/seo">
<link rel="alternate" hreflang="en" href="https://acme-payments-sites.butterix.com/en/guides/features/seo">
<link rel="alternate" type="text/markdown" href="/guides/features/seo.md" title="Markdown">
<meta property="og:type" content="article">
<meta property="og:site_name" content="ButterIX">
<meta property="og:title" content="SEO · ButterIX">
<meta property="og:url" content="https://acme-payments-sites.butterix.com/guides/features/seo">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@bitidocs">
<script type="application/ld+json">{"@type":"TechArticle", …}</script>
<script type="application/ld+json">{"@type":"BreadcrumbList", …}</script>
OutputSource
<title>seo.title-template (default {page} | {site}); the page title can be overridden with frontmatter og:title
descriptionfrontmatter description → og:description → subtitle → body excerpt
keywordsfrontmatter keywords
og:imagefrontmatter og:image → seo.og-image; with an image, the Twitter card automatically becomes summary_large_image
article:modified_timefrontmatter last-updated
robotsnoindex, nofollow is output for page noindex, noindex in the navigation, seo.noindex, or preview deployments

See Page metadata and docs.yml › SEO for field details.

canonical

  • Defaults to the page's own absolute URL, on the site's primary domain.
  • Older version pages point canonical to the same page in the default version, so similar content across versions doesn't compete for ranking. See Versions.
  • Set it manually with frontmatter canonical-url.

Structured data

Every page outputs two JSON-LD blocks:

  • TechArticle: title, description, URL, language (inLanguage), dateModified (when last-updated is set), and the parent WebSite.
  • BreadcrumbList: generated from the section path in the navigation, matching the breadcrumbs on the page.

sitemap.xml

/sitemap.xml contains every page (all languages and versions, except noindex pages and changelog date detail pages), and each URL carries xhtml:link entries for its other language versions:

sitemap.xml (excerpt)
<url>
  <loc>https://acme-payments-sites.butterix.com/guides/features/seo</loc>
  <xhtml:link rel="alternate" hreflang="zh" href="https://acme-payments-sites.butterix.com/guides/features/seo"/>
  <xhtml:link rel="alternate" hreflang="en" href="https://acme-payments-sites.butterix.com/en/guides/features/seo"/>
</url>

robots.txt and AI crawlers

The default robots.txt allows all crawlers and declares the sitemap:

robots.txt
User-agent: *
Allow: /

Sitemap: https://acme-payments-sites.butterix.com/sitemap.xml

Declare content use

seo.content-signal outputs Content-Signal in robots.txt, saying what your content may be used for. All three are optional booleans; ones you leave out aren't output:

docs.yml
seo:
  content-signal:
    search: true      # building a search index
    ai-input: true    # input for AI answers
    ai-train: false   # training models
robots.txt
User-agent: *
Content-Signal: search=yes, ai-input=yes, ai-train=no
Allow: /

Block AI crawlers

With seo.ai-crawlers: disallow, the following AI training and retrieval crawlers are additionally blocked:

  • GPTBot
  • ChatGPT-User
  • OAI-SearchBot
  • ClaudeBot
  • Claude-User
  • Claude-SearchBot
  • anthropic-ai
  • PerplexityBot
  • Google-Extended
  • Applebot-Extended
  • CCBot
  • Bytespider
  • meta-externalagent

Use your own robots.txt

docs.yml
agents:
  robots-txt: robots.txt   # relative to docs.yml

The file is published as it is; ai-crawlers and content-signal no longer apply.

With seo.noindex: true or on preview deployments, robots.txt is always Disallow: /, even with your own file.

Docs usually want to be read by AI: developers increasingly learn about an API through ChatGPT, Claude, and Cursor. ButterIX allows AI crawlers by default and provides .md and llms.txt so they read more accurately; see Agent-friendly.

Redirects

When restructuring, use redirects to keep the ranking of old links:

docs.yml
redirects:
  - source: /docs/getting-started
    destination: /guides/get-started/quickstart
  - source: /api/v1/:endpoint
    destination: /api-reference/:endpoint
  • 301 permanent redirects by default; permanent: false gives 302.
  • Redirects keep the query string; .md and .mdx URLs go to the Markdown of the target page.
  • When the home page isn't /, the root URL automatically 302-redirects to the home page.

URL normalization

  • Page URLs have no trailing slash; the runtime 308-redirects /guides/ to /guides to avoid duplicate URLs.
  • Nonexistent URLs return a real 404 status code and 404.html (with noindex); requests for Markdown get a Markdown 404.

Performance

Speed is itself a ranking factor:

  • Zero hydration: pages don't need to re-render in the browser.
  • Code highlighting happens at build time, and icons are combined into an in-page SVG sprite with no icon fonts loaded.
  • .br and .gz are precompressed at build time, and the runtime returns them directly based on Accept-Encoding.
  • Hashed static assets (styles, scripts, fonts) use a one-year immutable cache; HTML is revalidated every time.

Preview deployments

Every page of a preview deployment (pull requests, editor previews, biti deploy --preview) carries noindex, robots.txt blocks crawling, and a "Preview" banner appears at the top of the page, so previews never compete with the production site for indexing.