Agent directive: read the LLMS index for this site. Markdown versions of pages are available by appending .md to the page URL or by sending Accept: text/markdown.

Pages

Create landing pages and content templates

Landing pages

Add index.tsx to a group's root to create its landing page. For example, publish.os/docs/index.tsx renders /docs.

publish.os/
└── docs/
    ├── index.tsx
    └── content/
        └── install.mdx
// publish.os/docs/index.tsx
import type { IndexPageProps } from "@publish.os/nextjs/types";

export default function DocsPage({ site }: IndexPageProps) {
  return <main><h1>{site.name} docs</h1></main>;
}

Content templates

Add page.tsx next to the group's content/ directory to set the template for its content pages. For example, this template renders /blog/hello-world.

publish.os/
└── blog/
    ├── page.tsx
    └── content/
        └── hello-world.mdx
// publish.os/blog/page.tsx
import { MDX } from "@publish.os/nextjs/mdx";
import type { PageProps } from "@publish.os/nextjs/types";

export default function BlogPost({ page }: PageProps) {
  return (
    <article>
      <h1>{page.frontmatter.title}</h1>
      <MDX page={page} />
    </article>
  );
}