Add missing changesets

This commit is contained in:
SonMooSans
2024-01-01 01:26:48 +08:00
parent f995ad9216
commit 9929c5b3ae
7 changed files with 112 additions and 4 deletions
+30
View File
@@ -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} />
```
+12
View File
@@ -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"
```
+23
View File
@@ -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),
});
```
+2 -2
View File
@@ -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**
+29
View File
@@ -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**
+15
View File
@@ -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"
}