Skip to content
关于 Niansi

Getting Started

安装

参考 VitePress 的安装要求。

sh
$ npm add -D vitepress-theme-niansi@next
sh
$ pnpm add -D vitepress-theme-niansi@next
sh
$ yarn add -D vitepress-theme-niansi@next vue
sh
$ bun add -D vitepress-theme-niansi@next
guide,Getting Started

Layout Slots

主题的 <Layout/> 组件有一些插槽,能够被用来在页面的特定位置注入内容。

主题布局的全部可用插槽如下:

  • sidebar-menu-before
  • sidebar-menu-after
  • page-top
  • page-bottom
  • home-top
  • home-bottom
  • articleList-top
  • articleList-bottom
  • doc-top
  • doc-bottom
  • doc-header-top
  • doc-header-bottom
  • doc-content-top
  • doc-content-bottom
  • doc-tail-top
  • doc-tail-bottom
  • doc-recent-updates-top
  • doc-recent-updates-bottom
  • doc-hot-tags-top
  • doc-hot-tags-bottom
  • doc-outline-top
  • doc-outline-bottom
  • not-found
guide,Layout Slots

Theme Config

主题配置

基于 VitePress 移除了 VitePress 的一些主题配置选项,保留了必要的选项,添加一些新的选项。

移除的配置选项

type RemovedConfigKeys =
  | 'sidebar'
  | 'aside'
  | 'darkModeSwitchLabel'
  | 'carbonAds'
  | 'editLink'
  | 'lastUpdated'
  | 'sidebarMenuLabel'
  | 'langMenuLabel'
Theme Config