Skip to content
主题配置

主题配置

发表于 更新于
作者 廿四2 min 阅读

主题配置可以让你能够自定义主题。可以通过将 themeConfig 添加到配置文件来进行主题配置:

ts
import { defineConfig } from 'vitepress-theme-niansi'

export default defineConfig({
  title: 'Niansi',
  clearUrls: true,
  
  // 主题相关配置
  themeConfig: {
    author: '廿四',
    logo: '/niansi-logo.svg',
    // ...
  }
})

新增

author 新增

  • 类型:string

作者名称,显示在文章页面顶部。

sidebarBgImage 新增

  • 类型:string

侧边栏背景图片。

tagPath 新增

  • 类型:string
  • 默认值:/tags/

标签页路径。

categoryPath 新增

  • 类型:string
  • 默认值:/categories/

分类页路径。

archivesPath 新增

  • 类型:string
  • 默认值:/archives/

归档页路径。

recentlyUpdated 新增

  • 类型: string
  • 默认值: Recently Updated

最近更新文本。

trendingTags 新增

  • 类型: string
  • 默认值: Trending Tags

热门标签文本。

hamburgerHome 新增

  • 类型: string
  • 默认值: Home

汉堡菜单中的主页文本。

postedMeta 新增

  • 类型: string
  • 默认值: Posted

文章发布时间文本。

authorMeta 新增

  • 类型: string
  • 默认值: By

文章来源文本。

readMeta 新增

  • 类型: string
  • 默认值: Read

文章阅读量文本。

categoriesMeta 新增

  • 类型: string
  • 默认值: post

文章分类文本。

excerptLength 新增

  • 类型: number
  • 默认值: 300

文章摘要长度。

commentPlugin 新增

  • 类型: CommentPlugin

评论插件配置。详见 评论插件配置

移除

移除 VitePress 默认配置

  • aside
  • darkModeSwitchLabel
  • carbonAds
  • editLink
  • lastUpdated
  • sidebarMenuLabel

更新日志

2026-04-14 14:20
查看所有更新日志