import type { DefaultTheme } from 'valaxy/types' export namespace YunTheme { export type Config = ThemeConfig export type Sidebar = SidebarItem[] | SidebarMulti export interface SidebarMulti { [path: string]: SidebarItem[] | { items: SidebarItem[] base?: string } } export interface SidebarItem { /** Text displayed for the link or group. */ text: string /** Link target. Groups may omit it. */ link?: string /** Nested navigation items. */ items?: SidebarItem[] /** * Enables collapsing when defined. `true` starts collapsed and `false` * starts expanded. */ collapsed?: boolean /** Base path inherited by this item and its children. */ base?: string rel?: string target?: string } /** Homepage grid decoration. Pointer effects are opt-in. */ export interface BannerGrid { /** Show the grid. @default true */ enable?: boolean /** Fade the grid toward the edges. @default false */ fade?: boolean /** Highlight grid lines near a mouse pointer. @default false */ interactive?: boolean } export type HomeNavStyle = 'glass' | 'plain' | 'panel' | 'tiles' export interface Banner { /** * 是否启用 */ enable: boolean /** * @en Banner title * @zh 标题,默认每个字分割,你也可以通过数组的方式来自定义分割,如 ['Hello', 'World'] * * i18n: { 'en': 'Title', 'zh-CN': '标题' } * { en: ['Hello', 'World'], 'zh-CN': ['你好', '世界'] } */ title: string | string[] | Record /** * 首页下方的动态云 * If you want change color of cloud, please change css var `--yun-c-cloud` */ cloud?: { enable: boolean } /** * site-name class */ siteNameClass?: string /** Grid appearance for the nimbo homepage. */ grid?: BannerGrid /** Nimbo introduction layout. Grouped uses compact introduction dividers. @default 'classic' */ prologue?: 'classic' | 'grouped' /** Mobile homepage navigation appearance. @default 'plain' */ navStyle?: HomeNavStyle /** * @nimbo * @en Banner Animation Duration * @zh Banner 动画持续时间 * @default 500 */ duration?: number } } export interface EditLink { /** * @en Edit link pattern. Use `:path` as placeholder. * @zh 编辑链接模式,使用 `:path` 作为路径占位符 * @example 'https://github.com/user/repo/edit/main/:path' */ pattern: string /** * @en Custom label text */ text?: string } export interface PageProps { name: string /** * @description:en-US Page URL * @description:zh-CN 页面链接 */ url: string /** * @see https://valaxy.site/guide/features#icones * @description:en-US Icon of page * @description:zh-CN 页面图标 */ icon: string /** * @description:en-US Legacy link color; used for the icon in mobile homepage navigation * @description:zh-CN 原有链接颜色;移动端首页导航将此颜色用于图标 * @default 'var(--va-c-text)' */ color?: string /** Icon-only color. Takes priority over color without changing the label. */ iconColor?: string } /** * Theme Config */ export interface ThemeConfig extends DefaultTheme.Config { /** * Theme Type * - v1 strato 层云 Legacy * - v2 nimbo 雨云 * - cirro 卷云 (未来) * - cumulo 积云 (未来) * - alto 高云 (未来) * @default 'nimbo' */ type: 'strato' | 'nimbo' /** * toc title * @default 'On this page' */ outlineTitle: string /** * @zh 配色 */ colors: { /** * @en primary color * * @zh 主题色 * @default '#0078E7' */ primary: string } /** * 首页标语 */ banner: YunTheme.Banner /** Post list presentation; per-post title classes take precedence. */ postCard?: { /** Show the bottom excerpt gradient. @default true */ excerptGradient?: boolean /** Title classes. Set to an empty string for a solid color. */ titleClass?: string } /** Navigation material. */ navbar?: { /** Apply glass after scrolling, or also at the top. @default 'scroll' */ glass?: 'scroll' | 'always' } // /** // * prologue // * 开场白 // * @zh banner 之后的首页导航 // */ // prologue: { // enable: boolean // } /** * @en Background image * @zh 背景图 */ bg_image: { /** * @en Enable background image */ enable: boolean /** * @en Image url */ url?: string /** * @en Image url when dark mode */ dark?: string /** * @en Image opacity */ opacity?: number } /** * @en * say something * * @zh 说点什么 * - 自定义 API 链接,如 https://el-bot-api.elpsy.cn/api/words/young * 你可以通过在 public 下新建 json 的方式来使用, 如 public/young.json * ["Hello, World!", "Bye, World!"] */ say: { /** * @default false */ enable: boolean api: string hitokoto: { enable: boolean api: string } } /** * 公告 */ notice: { enable: boolean /** * @en Hide in /pages/[page] * @zh 在 /pages/[page] 中隐藏 */ hideInPages?: boolean content: string } /** * [@explosions/fireworks](https://www.npmjs.com/package/@explosions/fireworks) * @en - Fireworks when click * @zh - 点击时的烟花效果 */ fireworks: { enable: boolean /** * @en - Fireworks colors * @zh - 烟花颜色 * @default ['#66A7DD', '#3E83E1', '#214EC2'] */ colors?: string[] } /** * nav items * @zh 导航栏 * 位于页面顶部 */ nav?: NavItem[] /** * @en - Pages * @zh - 页面,显示在社交导航栏下方 */ pages: PageProps[] /** Navigation rendered by the `docs` layout. */ sidebar: YunTheme.Sidebar | null /** * footer */ footer: Partial<{ /** * @en The flowing cloud on top of the footer (If you want change color of cloud, please change css var `--yun-c-cloud`) * @zh 页脚上部的动态云 * @default { enable: true } */ cloud: { enable: boolean } /** * 建站于 */ since: number /** * Icon between year and copyright info. */ icon: Partial<{ /** * icon name, i-xxx */ enable: boolean name: string animated: boolean color: string url: string title: string }> /** * Powered by valaxy & valaxy-theme-${name}, default is yun */ powered: boolean /** * Chinese Users | 中国用户 * 备案 ICP * 国内用户需要在网站页脚展示备案 ICP 号 * https://beian.miit.gov.cn/ */ beian: { enable: boolean /** * 苏ICP备xxxxxxxx号 */ icp: string /** * @en Custom ICP link, default is https://beian.miit.gov.cn/ * @zh 自定义 ICP 备案链接,默认为 https://beian.miit.gov.cn/ * @default 'https://beian.miit.gov.cn/' */ icpLink?: string /** * 公安网备案号 * 苏公网安备xxxxxxxx号 * https://beian.mps.gov.cn/ */ police?: string } }> /** * @en Custom Post Card Types * @zh 自定义文章卡片类型 */ types: Record /** * @en Menu Bar * @zh 菜单栏 */ menu: { /** * @zh 最右侧的导航图标 */ custom: { title: string url: string icon: string } } /** * @en Edit link configuration for "Open in GitHub" or similar services * @zh 编辑链接配置,用于「在 GitHub 中打开」等功能 */ editLink?: EditLink } export type UserThemeConfig = Partial /** * For user links */ export interface LinkType { avatar: string name: string url: string color: string blog: string desc: string } export interface NavItemLink { icon?: string link: string text: string active?: string } export interface NavItemGroup { text: string items: NavItemLink[] } // export type NavItem = NavItemLink | NavItemGroup export type NavItem = NavItemLink /** * @deprecated Use `GirlEntry` from `valaxy-addon-girls`. */ export type GirlType = import('valaxy-addon-girls').GirlEntry export * from '../composables' export * from './projects'