diff --git a/docs/notes/theme/config/主题配置.md b/docs/notes/theme/config/主题配置.md index e94436f3..e054349e 100644 --- a/docs/notes/theme/config/主题配置.md +++ b/docs/notes/theme/config/主题配置.md @@ -145,6 +145,13 @@ interface BlogOptions { */ categoriesExpand?: number | 'deep' + /** + * 文章分类列表转换函数,比如排除不需要的一级分类 + * @param categories 分类列表 + * @returns 返回一个新的分类列表 + */ + categoriesTransform?: (categories: PageCategoryData[]) => PageCategoryData[] + /** * 博客文章封面图 * diff --git a/theme/src/client/components/Blog/VPBlogNav.vue b/theme/src/client/components/Blog/VPBlogNav.vue index 9171ee7d..92a0c338 100644 --- a/theme/src/client/components/Blog/VPBlogNav.vue +++ b/theme/src/client/components/Blog/VPBlogNav.vue @@ -15,6 +15,7 @@ const { hasBlogExtract, tags, archives, categories } = useBlogExtract()