Tangly v0.2 ships richer code blocks, page chrome, and more — see what's new

Page anatomy

Frontmatter, body, and the conventions Tangly expects on every page.

~ 3 min read

Page anatomy

A Tangly page is an .mdx file with YAML frontmatter at the top and MDX body underneath. That’s the whole structure.

mdx
---
title: Page title
description: One-line description for search results and OG tags.
icon: book
---

The page body. Markdown. MDX components. JSX expressions if you need them.

## Sections

Headings auto-generate ids — link to them as `/page#sections`.

Frontmatter

The YAML block at the top. Parsed by gray-matter, validated against the frontmatter schema.

Minimum

Most pages only need two fields:

yaml
---
title: Quickstart
description: 60-second tour.
---

Common

FieldWhen to use
titleAlways. Renders as page H1, sidebar entry, browser tab, OG title.
descriptionAlways. Subtitle below H1, meta description, OG description.
iconIf the page is in a Card on a landing page or in a sidebar entry.
sidebarTitleWhen title is too long for the sidebar (e.g. title: "Authentication and authorization", sidebarTitle: "Auth").
tagBeta / new / deprecated chip on the sidebar entry.
draftWhile drafting. Hidden in production builds.
noindexWhen the page shouldn’t appear in search engines or llms.txt.
modeWhen the page needs an unusual layout (wide, center, custom).

For the full list, see Frontmatter.

The body

Standard CommonMark + GFM extensions + JSX components. See Markdown & MDX for the full reference.

Don’t write your own H1

The page H1 renders automatically from the title frontmatter field. Don’t add a # Title line (or <h1>) at the top of the body — you’ll get two H1s.

mdx
---
title: Quickstart
---

This is the first paragraph. No `# Quickstart` line above it.

tangly dev warns in the terminal when it finds an H1 in content so you can catch this while authoring.

Use H2 for sections

Top-level sections under the page H1 should be ## H2. The right-rail TOC indexes H2 and H3 only. Skip levels and you’ll confuse the TOC.

Component conventions

Built-in MDX components are auto-injected. No imports.

mdx
<Note>This shows up everywhere — no import needed.</Note>

For custom components, drop them in theme/ at your project root and reference them by name. See Custom components.

Linking

Internal links use absolute slugs without .mdx:

md
See [Quickstart](/quickstart) for the 60-second tour.
See [API auth](/reference/schema/api#auth-methods) for headers.

tangly check validates internal links at build time.

External links open in new tabs automatically:

md
[Astro](https://astro.build)

Images

Drop them in images/ (or static/, public/, assets/). Reference by absolute path:

md
![Architecture](/images/architecture.png)

Every image gets a lightbox on click. To opt out, see <LightboxImage>.

Section headings + anchors

Every heading auto-generates a slug-style id:

md
## Rate limits        <!-- id="rate-limits" -->
## Things & stuff     <!-- id="things-stuff" -->

For stable ids that survive heading renames, pin them:

md
## Rate limits {#rate-limits}

Where pages live

The slug is the path from the project root, no .mdx:

File pathSlugURL
introduction.mdxintroduction/introduction
guides/getting-started.mdxguides/getting-started/guides/getting-started
reference/cli/dev.mdxreference/cli/dev/reference/cli/dev

The slug is what you reference in docs.json#navigation and what you link from other pages.

Validation

tangly check runs frontmatter validation against the schema, walks every internal link, and confirms every navigation entry resolves to a real file. Run it before committing:

bash
bunx tangly check

For strict mode (warnings become errors):

bash
bunx tangly check --strict

What goes where

Coming from Mintlify, the conventions here will feel familiar — Tangly mostly inherits them. The exceptions:

  • Tangly auto-renders the H1 from title. Don’t repeat it in the body.
  • Internal links are absolute slugs; no .mdx extension.
  • Images live under recognized roots (images/, static/, public/, assets/).
  • Frontmatter is non-fatal — invalid fields warn, don’t fail.

For the full delta, see Migration → Compatibility.

Last updated Edit this page
↑↓ navigate open esc close