查找邻居页面
从页面树中查找页面的邻居页面
从页面树中查找页面的邻居页面,它返回给定页面的下一个和前一个页面。这对于实现页脚很有用。
用法
它需要页面树和页面的 URL。
import { findNeighbour } from 'fumadocs-core/server';
import { pageTree } from '@/lib/source';
const neighbours = findNeighbour(pageTree, '/url/to/page');| 参数 | 类型 | 描述 |
|---|---|---|
| tree | PageTree | 页面树 |
| url | string | 页面的 URL |
How is this guide?
Last updated on
