Skip to content
@teasim/astro documentation

@teasim/astro

The content layer — navigation, validation, markdown twins, and machine-readable routes.

@teasim/astro is the half of a documentation site that has nothing to do with how it looks. It validates content, computes navigation, and publishes human and machine-readable routes without rendering a component.

This guide targets Astro integration 0.5.0. The package requires Node.js 24.2.0 or later and Astro >=7.2.10; it has no TeaCSS peer.

Install

sh
bun add @teasim/[email protected] astro@^7.3.8

Configure the @teasim registry and package-read credential as shown in Astra installation. Register teasim() from @teasim/astro in astro.config.mjs, then define collections with contentCollection() so their mounts can be shared by HTML pages, markdown twins, and llms.txt.

ts
import { defineConfig } from "astro/config";
import { teasim } from "@teasim/astro";

export default defineConfig({
  site: "https://example.com",
  integrations: [teasim()],
});

site belongs to Astro configuration; integration options belong to teasim(). The integration manages MDX and the supported code-notation transformers, while the application supplies the page layout and routes. astro is the only required peer. satteri is an optional type peer already installed by Astro. garfish, pagefind, and @astrojs/rss are optional peers needed only for micro-application hosting, search, and RSS respectively; ordinary content sites do not need to add them. The CLI’s init command preserves existing declared dependency versions, so it is not an upgrade command.

Core responsibilities

  • Validate content while naming the entry that needs attention
  • Build sidebars, breadcrumbs, table-of-contents data, and previous/next links
  • Serve a .md twin for every published page
  • Generate llms.txt and llms-full.txt from the same content

Why it is separate

A content helper that also renders markup decides how your site is built. That is a borrowed decision, so computing stays separate from rendering: @teasim/astro renders nothing, while @teasim/astra and @teasim/aster know nothing about content. Either half works on its own.

Validation that names the page

Collection schemas validate frontmatter. After loading a collection, use composeEntries from @teasim/astro/content; it preserves the collection entries for rendering and maps their complete metadata for navigation:

ts
import { getCollection } from "astro:content";
import { composeEntries } from "@teasim/astro/content";
import { getNavigation } from "@teasim/astro";

const docs = composeEntries(await getCollection("docs"), { name: "docs" });
const navigation = getNavigation(docs.entries, { base: "/docs" });
// docs.collection retains the loaded collection; docs.routable feeds HTML routes.

Composition reports content problems by slug in development by default; validate: true enables that reporting explicitly in another environment. Use validateContent to inspect the reported problems or assertContent to fail an explicit validation gate. Retain collection / routable for Astro render() and route generation, and entries for navigation. Hand-mapping only titles and slugs discards metadata such as prev, next, and externalLink before validation can see it.

Continue reading

See Project structure for a complete site scaffold and createNavigation for the navigation API.