mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 23:49:51 +00:00
Add missing changesets
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
---
|
||||
'next-docs-zeta': major
|
||||
---
|
||||
|
||||
**Migrate Contentlayer Integration to Source API**
|
||||
|
||||
`createContentlayer` is now replaced by `createContentlayerSource`.
|
||||
|
||||
You should configure base URL and root directory in the loader instead of Contentlayer configuration.
|
||||
|
||||
It's no longer encouraged to access `allDocs` directly because they will not include `url` property anymore. Please consider `getPages` instead.
|
||||
|
||||
```ts
|
||||
import { allDocs, allMeta } from 'contentlayer/generated';
|
||||
import { createContentlayerSource } from 'next-docs-zeta/contentlayer';
|
||||
import { loader } from 'next-docs-zeta/source';
|
||||
|
||||
export const { getPage, pageTree, getPages } = loader({
|
||||
baseUrl: '/docs',
|
||||
rootDir: 'docs',
|
||||
source: createContentlayerSource(allMeta, allDocs),
|
||||
});
|
||||
```
|
||||
|
||||
The interface is very similar, but you can only access Contentlayer properties from `page.data`.
|
||||
|
||||
```diff
|
||||
- <Content code={page.body.code} />
|
||||
+ <Content code={page.data.body.code} />
|
||||
```
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
'next-docs-mdx': major
|
||||
---
|
||||
|
||||
**Prefer `.map.ts` instead of `_map.ts`**
|
||||
|
||||
Unless you have especially configured, now it uses `.map.ts` by default.
|
||||
|
||||
```diff
|
||||
- import map from "@/_map"
|
||||
+ import map from "@/.map"
|
||||
```
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
'next-docs-mdx': major
|
||||
---
|
||||
|
||||
**Migrate to Source API**
|
||||
|
||||
`fromMap` has been removed. Please use `createMDXSource` instead.
|
||||
|
||||
```ts
|
||||
import { map } from '@/.map';
|
||||
import { createMDXSource } from 'next-docs-mdx';
|
||||
import { loader } from 'next-docs-zeta/source';
|
||||
|
||||
export const {
|
||||
getPage,
|
||||
getPages,
|
||||
pageTree,
|
||||
} = loader({
|
||||
baseUrl: '/docs',
|
||||
rootDir: 'docs',
|
||||
source: createMDXSource(map),
|
||||
});
|
||||
```
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
'create-next-docs-app': minor
|
||||
'create-next-docs-app': major
|
||||
---
|
||||
|
||||
Support template for Tailwind CSS + Next Docs MDX
|
||||
**Support template for Tailwind CSS + Next Docs MDX**
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
'next-docs-zeta': major
|
||||
---
|
||||
|
||||
**Source API**
|
||||
|
||||
To reduce boilerplate, the Source API is now released to handle File-system based files.
|
||||
|
||||
Thanks to this, you don't have to deal with the inconsistent behaviours between different content sources anymore.
|
||||
|
||||
The interface is now unified, you can easily plug in a content source.
|
||||
|
||||
```ts
|
||||
import { map } from '@/.map';
|
||||
import { createMDXSource } from 'next-docs-mdx';
|
||||
import { loader } from 'next-docs-zeta/source';
|
||||
|
||||
export const {
|
||||
getPage,
|
||||
getPages,
|
||||
pageTree,
|
||||
} = loader({
|
||||
baseUrl: '/docs',
|
||||
rootDir: 'docs',
|
||||
source: createMDXSource(map),
|
||||
});
|
||||
```
|
||||
|
||||
**Page Tree Builder API is removed in favor of this**
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
'next-docs-ui': minor
|
||||
'next-docs-zeta': minor
|
||||
---
|
||||
|
||||
**Support multiple page tree roots**
|
||||
|
||||
You can specify a `root` property in `meta.json`, the nearest root folder will be used as the root of page tree instead.
|
||||
|
||||
```json
|
||||
{
|
||||
"title": "Hello World",
|
||||
"root": true
|
||||
}
|
||||
```
|
||||
@@ -1,4 +1,3 @@
|
||||
{
|
||||
"title": "MDX Plugins",
|
||||
"pages": ["..."]
|
||||
"title": "MDX Plugins"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user