.tsx, .ts, .jsx, .js, .mdx, or .md files directly in your MDX pages. This lets you use custom React components and shared Markdown snippets alongside the built-in MDX components.12345import { PricingTable } from '/components/pricing-table' # Pricing <PricingTable />
./ or ../) over absolute imports. They are simpler, work
consistently regardless of pagesDir, and match standard JavaScript conventions.12import { Badge } from '../components/badge' import Guide from './snippets/guide.md'
/)/ means the project root. Holocron probes the pages directory first, then the project root:1import { Chart } from '/components/chart'
pagesDir is ./pages, this looks for:./pages/components/chart.tsx (pages dir first)./components/chart.tsx (project root fallback)pagesDir is set. Prefer relative imports instead.README.md as the docs index so the same
file renders on both GitHub and the Holocron site. The README links to other
docs, and those links must work in both places..md or .mdx. Do not reason about slugs, pagesDir, or where
/ ends up. Write the link the way you would for GitHub — a relative path to the
actual file on disk — and Holocron does the rest..md/.mdx
extension. So a link to a real file lands on that file's page automatically.pagesDir, or vice versa..md/.mdx file on
disk at the relative path you write. That is what GitHub opens and what
Holocron rewrites. Missing file means a GitHub 404 and a Holocron warning../ or ../), never absolute. The README
renders from different base directories on GitHub and Holocron, so an absolute
/docs/x or a guessed path breaks in one of them..md/.mdx extension. GitHub needs it to open the file; Holocron
strips it so the link resolves to the rendered page.docs.json, the link resolves. Otherwise the site 404s — add the page and put
it in navigation.README.md [pricing](./docs/pricing.md) ◄── correct relative path to a real file │ ├───────────────────────► GitHub opens ./docs/pricing.md │ ▼ imported into the index page Holocron recomputes the path ──► strips .md ──► lands on the page rendering pricing │ ▼ /docs/pricing ◄── resolves as long as a page renders that file and it is in docs.json
snippets/ or components/ directories. Any local file can be imported from any location..tsx, .ts, .jsx, .js, .mdx, .md. You do not need to include the extension in the import path.snippets/ directory for reusable content:my-docs/ ├── snippets/ │ └── install-command.tsx ├── getting-started.mdx └── docs.json
123456789// snippets/install-command.tsx export function InstallCommand() { return ( <div> <div>npm install @holocron.so/vite</div> <div>pnpm add @holocron.so/vite</div> </div> ) }
12345import { InstallCommand } from '/snippets/install-command' # Getting Started <InstallCommand />