主题 Yun 自定义

为文章添加「在 GitHub 中编辑」链接。

valaxy.config.ts
ts
import type { ThemeConfig } from 'valaxy-theme-yun'
import { defineValaxyConfig } from 'valaxy'

export default defineValaxyConfig<ThemeConfig>({
  themeConfig: {
    editLink: {
      pattern: 'https://github.com/user/repo/edit/main/:path',
      text: '在 GitHub 上编辑此页',
    },
  },
})

大纲标题

目录标题文本。

valaxy.config.ts
ts
import type { ThemeConfig } from 'valaxy-theme-yun'
import { defineValaxyConfig } from 'valaxy'

export default defineValaxyConfig<ThemeConfig>({
  themeConfig: {
    /**
     * @default 'On this page'
     */
    outlineTitle: '本页目录',
  },
})

样式

通过创建 styles/index.ts 覆盖主题样式:

styles/index.ts
ts
import './vars.scss'
styles/vars.scss
scss
:root {
  --yun-bg-img: url("https://example.com/bg.jpg");
  --yun-sidebar-bg-img: url("https://example.com/sidebar.jpg");
  --yun-c-cloud: pink;
}

贡献者