Written by
Hanzo AIAt
Sat Sep 20 2025Runtime improvements & LLM integrations.
Overview
Hanzo Docs MDX v12 mainly aims to unify Hanzo Docs MDX on Vite and Next.js.
It contains renames to certain APIs (import paths are unaffected), migrations may be necessary.
Breaking Changes
Next.js
Removed content on page data in favour of getText().
Before
After
import { source } from '@/lib/source';
const page = source.getPage(['...']);
console.log(page.data.content);import { source } from '@/lib/source';
const page = source.getPage(['...']);
console.log(await page.data.getText('raw'));API Renames on page data:
_file->info._file.absolutePath->info.fullPath.
Before
After
import { source } from '@/lib/source';
const page = source.getPage(['...']);
console.log(page._file, page._file.absolutePath);import { source } from '@/lib/source';
const page = source.getPage(['...']);
console.log(page.info, page.info.fullPath);Improvements
Vite
Added APIs for info to access raw file info.
import { source } from '@/lib/source';
const page = source.getPage(['...']);
console.log(page.info);getText()
You can use it to access:
- Raw Markdown content.
- Processed Markdown before being compiled into HAST (HTML).
This is useful for llms.txt generation when used with docs generations tools & remark plugins.
import { source } from '@/lib/source';
const page = source.getPage(['...']);
console.log(await page.data.getText('raw'));
console.log(await page.data.getText('processed'));To access processed Markdown content, you need to enable includeProcessedMarkdown in collection config.
import { defineDocs } from '@hanzo/docs/mdx/config';
export default defineDocs({
docs: {
postprocess: {
includeProcessedMarkdown: true,
},
},
});