import { defineTeekConfig } from "vitepress-theme-teek/config"; import { version } from "vitepress-theme-teek/es/version"; let wallPapper = [ "/wall/DragaliaLost/1.png", "/wall/DragaliaLost/2.png", "/wall/DragaliaLost/3.png", "/wall/DragaliaLost/4.png", "/wall/Legendz/1.png", "/wall/Warframe/Gauss.jpg", "/wall/Warframe/Sevagoth.png", ] // Teek 主题配置 export const teekConfig = defineTeekConfig({ teekHome: true, // 是否开启博客首页 vpHome: false, // 是否隐藏 VP 首页 sidebarTrigger: true, // 是否开启侧边栏折叠功能 author: { name: "唐尼瑞姆" }, // 作者名称 // loading: true, // 启用 Loading 动画,为 false 则关闭 Loading 动画 loading: "正在加载中...", // 修改 Loading 文案 anchorScroll: false, themeSize: "default", viewTransition: { enabled: true, // 是否启用深浅色切换动画效果 mode: "out-in", // 动画模式,out 始终从点击点往全屏扩散,out-in 第一次从点击点往全屏扩散,再次点击从全屏回到点击点 duration: 300, // 动画持续时间,当 mode 为 out 时,默认为 300ms,mode 为 out-in 时,默认为 600ms easing: "ease-in", // 缓动函数 }, backTop: { enabled: true, // 是否启动回到顶部功能 content: "icon", // 回到顶部按钮的显示内容,可选配置 progress | icon done: TkMessage => TkMessage.success("返回顶部成功"), // 回到顶部后的回调 }, toComment: { enabled: true, // 是否启动滚动到评论区功能 done: TkMessage => TkMessage.success("已抵达评论区"), // 滚动到评论区后的回调 }, codeBlock: { enabled: true, // 是否启用新版代码块 collapseHeight: 700, // 超出高度后自动折叠,设置 true 则默认折叠,false 则默认不折叠 overlay: false, // 代码块底部是否显示展开/折叠遮罩层 overlayHeight: 400, // 当出现遮罩层时,指定代码块显示高度,当 overlay 为 true 时生效 langTextTransform: "capitalize", // 语言文本显示样式,为 text-transform 的值:none, capitalize, lowercase, uppercase copiedDone: TkMessage => TkMessage.success("复制成功!"), // 复制代码完成后的回调 }, windowTransition: true, // siteAnalytics: [ // { // provider: "google", // options: { // id: "G-X0J76E1E8Y", // }, // }, // { // provider: "baidu", // options: { // id: "******", // }, // }, // ], banner: { enabled: true, // 是否启用 Banner name: "DowneyRem's Blog", // Banner 标题,默认读取 vitepress 的 title 属性 bgStyle: "fullImg", // Banner 背景风格:pure 为纯色背景,partImg 为局部图片背景,fullImg 为全屏图片背景 pureBgColor: "#28282d", // Banner 背景色,bgStyle 为 pure 时生效 imgSrc: wallPapper, // Banner 图片链接。bgStyle 为 partImg 或 fullImg 时生效 imgInterval: 5000, // 当多张图片时(imgSrc 为数组),设置切换时间,单位:毫秒 imgShuffle: false, // 图片是否随机切换,为 false 时按顺序切换,bgStyle 为 partImg 或 fullImg 时生效 imgWaves: true, // 是否开启 Banner 图片波浪纹,bgStyle 为 fullImg 时生效 mask: true, // Banner 图片遮罩,bgStyle 为 partImg 或 fullImg 时生效 maskBg: "rgba(0, 0, 0, 0.4)", // Banner 遮罩颜色,如果为数字,则是 rgba(0, 0, 0, ${maskBg}),如果为字符串,则作为背景色。bgStyle 为 partImg 或 fullImg 且 mask 为 true 时生效 textColor: "#ffffff", // Banner 字体颜色,bgStyle 为 pure 时为 '#000000',其他为 '#ffffff' titleFontSize: "3.2rem", // 标题字体大小 descFontSize: "1.4rem", // 描述字体大小 descStyle: "types", // 描述信息风格:default 为纯文字渲染风格(如果 description 为数组,则取第一个),types 为文字打印风格,switch 为文字切换风格 description: [ "Stay hungry, stay foolish —— Steve Jobs", "Done is better than perfect —— FaceBook", "Talk is cheap. Show me the code. —— Linus Torvalds", "种一棵树最好的时间是十年前,其次是现在", "不积跬步,无以至千里;不积小流,无以成江海 —— 荀子", "万物皆有裂痕,那是光照进来的地方 —— 萊昂納德·科恩", "不如意事常八九,可与言者无二三", ], // 描述信息 switchTime: 4000, // 描述信息切换间隔时间,单位:毫秒。descStyle 为 switch 时生效 switchShuffle: false, // 描述信息是否随机切换,为 false 时按顺序切换。descStyle 为 switch 时生效 typesInTime: 200, // 输出一个文字的时间,单位:毫秒。descStyle 为 types 时生效 typesOutTime: 100, // 删除一个文字的时间,单位:毫秒。descStyle 为 types 时生效 typesNextTime: 800, // 打字与删字的间隔时间,单位:毫秒。descStyle 为 types 时生效 typesShuffle: false, // 描述信息是否随机打字,为 false 时按顺序打字,descStyle 为 types 时生效 }, wallpaper: { enabled: true, // 是否启用壁纸模式 hideBanner: false, // 开启壁纸模式后,是否隐藏 Banner hideMask: true, // 开启壁纸模式后,是否隐藏 Banner 或 bodyBgImage 的遮罩层,则确保 banner.mask 和 bodyBgImage.mask 为 true 才生效 }, // 文章列表 post: { postStyle: "list", // 文章列表风格 excerptPosition: "top", // 文章摘要位置 showMore: true, // 是否显示更多按钮 moreLabel: "阅读全文 >", // 更多按钮文字 emptyLabel: "暂无文章", // 文章列表为空时的标签 coverImgMode: "default", // 文章封面图模式 showCapture: false, // 是否在摘要位置显示文章部分文字,当为 true 且不使用 frontmatter.describe 和 时,会自动截取前 300 个字符作为摘要 splitSeparator: false, // 文章信息(作者、创建时间、分类、标签等信息)是否添加 | 分隔符 transition: true, // 是否开启过渡动画 transitionName: "tk-slide-fade", // 自定义过渡动画名称 listStyleTitleTagPosition: "right", // 列表模式下的标题标签位置(postStyle 为 list) cardStyleTitleTagPosition: "left", // 卡片模式下的标题标签位置(postStyle 为 card) defaultCoverImg: [], // 默认封面图地址,如果不设置封面图则使用默认封面图地址 }, // 卡片栏: homeCardListPosition: "right", homeCardSort: ["topArticle", "category", "tag", "friendLink", "docAnalysis"], tagColor: [ { border: "#bfdbfe", bg: "#eff6ff", text: "#2563eb" }, { border: "#e9d5ff", bg: "#faf5ff", text: "#9333ea" }, { border: "#fbcfe8", bg: "#fdf2f8", text: "#db2777" }, { border: "#a7f3d0", bg: "#ecfdf5", text: "#059669" }, { border: "#fde68a", bg: "#fffbeb", text: "#d97706" }, { border: "#a5f3fc", bg: "#ecfeff", text: "#0891b2" }, { border: "#c7d2fe", bg: "#eef2ff", text: "#4f46e5" }, ], blogger: { name: "唐尼瑞姆", // 博主昵称 // slogan: "朝圣的使徒,正在走向编程的至高殿堂!", // 博主签名 // avatar: "https://www.github.com/DowneyRem.png", // 博主头像 avatar: "favicon.png", // 博主头像 shape: "circle-rotate", // 头像风格:square 为方形头像,circle 为圆形头像,circle-rotate 可支持鼠标悬停旋转,circle-rotate-last 将会持续旋转 59s circleBgImg: "/wall/DragaliaLost/0.png", // 背景图片 circleBgMask: true, // 遮罩层是否显示,仅当 shape 为 circle 且 circleBgImg 配置时有效 circleSize: 100, // 头像大小 color: "#ffffff", // 字体颜色 }, topArticle: { enabled: true, // 是否启用精选文章卡片 title: "📌精选文章", // 卡片标题 emptyLabel: "暂无精选文章", // 精选文章为空时的标签 limit: 5, // 一页显示的数量 autoPage: false, // 是否自动翻页 pageSpeed: 4000, // 翻页间隔时间,单位:毫秒。autoPage 为 true 时生效 dateFormat: "yyyy-MM-dd", // 精选文章的日期格式 }, category: { enabled: true, // 是否启用分类卡片 path: "/categories", // 分类页访问地址 pageTitle: "📁全部分类", // 分类页卡片标题 homeTitle: "📁文章分类", // 卡片标题 moreLabel: "更多 ...", // 查看更多分类标签 emptyLabel: "暂无文章分类", // 分类为空时的标签 limit: 5, // 一页显示的数量 autoPage: false, // 是否自动翻页 pageSpeed: 4000, // 翻页间隔时间,单位:毫秒。autoPage 为 true 时生效 }, tag: { enabled: true, // 是否启用标签卡片 path: "/tags", // 标签页访问地址 pageTitle: "#️⃣全部标签", // 标签页页卡片标题 homeTitle: "#️⃣热门标签", // 卡片标题 moreLabel: "更多 ...", // 查看更多分类标签 emptyLabel: "暂无标签", // 标签为空时的标签 limit: 21, // 一页显示的数量 autoPage: false, // 是否自动翻页 pageSpeed: 4000, // 翻页间隔时间,单位:毫秒。autoPage 为 true 时生效 }, friendLink: { enabled: false, // 是否启用友情链接卡片 list: [ { name: "Pixiv 书源", desc: "最好的 Pixiv 小说阅读器", avatar: "https://downeyrem.github.io/PixivSource/favicon-512x512.png", link: "https://downeyrem.github.io/PixivSource", }, { name: "兽人阅读", desc: "兽人小说,精品阅读", avatar: "/img/FurryReading.png", link: "https://t.me/FurryReading", }, ], // 友情链接数据列表 title: "🤝友情链接", // 卡片标题 emptyLabel: "暂无友情链接", // 友情链接为空时的标签 limit: 5, // 一页显示的数量 autoScroll: false, // 是否自动滚动 scrollSpeed: 2500, // 滚动间隔时间,单位:毫秒。autoScroll 为 true 时生效 autoPage: false, // 是否自动翻页 pageSpeed: 4000, // 翻页间隔时间,单位:毫秒。autoPage 为 true 时生效 }, docAnalysis: { enabled: true, // 是否启用站点信息卡片 createTime: "2025-12-31", // 站点创建时间 wordCount: true, // 是否开启文章页的字数统计 readingTime: true, // 是否开启文章页的阅读时长统计 // 访问量、访客数统计配置 statistics: { provider: "google", // 网站流量统计提供商 siteView: true, // 是否开启首页的访问量和排名统计 pageView: true, // 是否开启文章页的浏览量统计 tryRequest: false, // 如果请求网站流量统计接口失败,是否重试 tryCount: 5, // 重试次数,仅当 tryRequest 为 true 时有效 tryIterationTime: 2000, // 重试间隔时间,单位:毫秒,仅当 tryRequest 为 true 时有效 permalink: true, // 是否只统计永久链接的浏览量,如果为 false,则统计 VitePress 默认的文档目录链接 }, // 自定义现有信息 overrideInfo: [ { key: "lastActiveTime", label: "活跃时间", value: (_, currentValue) => (currentValue + "").replace("前", ""), show: true, }, { key: "totalPosts", label: "文章总数" } ], // 自定义额外信息 // appendInfo: [{ key: "index", label: "序号", value: "天客 99" }], }, social: [ { icon: "mdi:github", name: "GitHub", link: "https://github.com/DowneyRem", }, { icon: "mdi:telegram", name: "Telegram", link: "https://t.me/DowneyRem", }, { icon: "mdi:twitter", name: "Twitter", link: "https://x.com/DowneyRemDragon", }, { icon: "https://asset.brandfetch.io/idIlKj_n7C/idSsbP7h1m.png", name: "Pixiv", link: "https://www.pixiv.net/users/119908520", }, ], footerInfo: { // 页脚信息,支持 HTML 格式(位于主题版权上方) // topMessage: ["下面的内容和图标都可以修改(本条内容也可以隐藏的)"], // 页脚信息,支持 HTML 格式(位于主题版权下方) // bottomMessage: ["上面的内容和图标都可以修改(本条内容也可以隐藏的)"], // 主题版权配置 theme: { show: true, // 是否显示主题版权,建议显示 name: "Theme By Teek@1.5.4", // 自定义名称 link: "https://github.com/Kele-Bingtang/vitepress-theme-teek", // 自定义链接 }, // 博客版权配置 copyright: { show: true, // 是否显示博客版权 createYear: 2025, // 创建年份 suffix: "唐尼瑞姆", // 后缀 }, // // ICP 备案信息配置 // icpRecord: { // name: "桂ICP备2021009994号", // link: "http://beian.miit.gov.cn/", // }, // // 网络安全备案信息配置 // securityRecord: { // name: "", // link: "", // }, }, articleBanner: { enabled: true, // 是否启用单文章页 Banner showCategory: true, // 是否展示分类 showTag: true, // 是否展示标签 defaultCoverImg: "", // 默认封面图 defaultCoverBgColor: "", // 默认封面背景色,优先级低于 defaultCoverImg }, breadcrumb: { enabled: true, // 是否启用面包屑 showCurrentName: false, // 面包屑最后一列是否显示当前文章的文件名 separator: "/", // 面包屑分隔符 homeLabel: "首页", // 鼠标悬停首页图标的提示文案 }, articleAnalyze: { showIcon: true, // 作者、日期、分类、标签、字数、阅读时长、浏览量等文章信息的图标是否显示 dateFormat: "yyyy-MM-dd hh:mm:ss", // 文章日期格式,首页和文章页解析日期时使用 dateUTC: true, // 是否使用 UTC 时间 showInfo: true, // 是否展示作者、日期、分类、标签、字数、阅读时长、浏览量等文章信息,分别作用于首页和文章页 showAuthor: true, // 是否展示作者 showCreateDate: true, // 是否展示创建日期 showUpdateDate: false, // 是否展示更新日期,仅在文章页显示 showCategory: false, // 是否展示分类 showTag: false, // 是否展示标签 teleport: { selector: "h1", position: "after", className: "h1-bottom-info", }, }, // breadcrumb: { // enabled: true, // 是否启用面包屑 // showCurrentName: false, // 面包屑最后一列是否显示当前文章的文件名 // separator: "/", // 面包屑分隔符 // homeLabel: "首页", // 鼠标悬停首页图标的提示文案 // }, pageStyle: "segment-nav", // appreciation: { // position: "doc-after", // 赞赏位置 // // 赞赏配置 // options: { // icon: "weChatPay", // 赞赏图标,内置 weChatPay 和 alipay // expandTitle: "打赏支持", // 展开标题,支持 HTML // collapseTitle: "下次一定", // 折叠标题,支持 HTML // content: ``, // 赞赏内容,支持 HTML // expand: false, // 是否默认展开,默认 false // // icon: "alipay", // 赞赏图标,内置 weChatPay 和 alipay // expandTitle: "打赏支持", // 展开标题,支持 HTML // collapseTitle: "下次一定", // 折叠标题,支持 HTML // content: ``, // 赞赏内容,支持 HTML // expand: false, // 是否默认展开,默认 false // }, // }, articleShare: { enabled: true, // 是否开启文章链接分享功能 text: "分享此页面", // 分享按钮文本 copiedText: "链接已复制", // 复制成功文本 query: false, // 是否包含查询参数 hash: false, // 是否包含哈希值 }, articleTopTip: (frontmatter, localeIndex, page) => { const tip: Record = { type: "warning", text: "文章发布较早,内容可能过时,阅读注意甄别。", }; // 大于半年,添加提示 const longTime = 6 * 30 * 24 * 60 * 60 * 1000; if (frontmatter.date && Date.now() - new Date(frontmatter.date).getTime() > longTime) return tip; }, // articleBottomTip: frontmatter => { // if (typeof window === "undefined") return; // // const hash = false; // const query = false; // const { origin, pathname, search } = window.location; // const url = `${origin}${frontmatter.permalink ?? pathname}${query ? search : ""}${hash ? location.hash : ""}`; // const author = "唐尼瑞姆"; // // return { // type: "tip", // // title: "声明", // 可选 // text: `

作者:${author}

//

链接:${decodeURIComponent(url)}

//

版权:此文章版权归 ${author} 所有,如有转载,请注明出处!

// `, // }; // }, articleUpdate: { enabled: true, // 是否启用文章最近更新栏 limit: 3, // 文章最近更新栏显示数量 }, private: { enabled: true, expire: "1h", session: true, siteLogin: false, pages: [ { username: "teek", password: "teek", expire: "1d", session: true, strategy: "once" }, ], realm: { blog: [ { username: "teek", password: "teek", expire: "1d", session: true, strategy: "once" }, ], comment: [ { username: "teek", password: "teek", expire: "1d", session: true, strategy: "always" }, ], }, // onFocus: (value, formName) => {}, // onBlur: (value, formName) => {}, // doLogin: (loginInfo, type, nativeExecLogin) => true, // doValidate: (type, frontmatter, nativeExecLogin) => true, // encrypt: (value, frontmatter) => value, // decrypt: (value, frontmatter) => value, }, // post: { // coverImgMode: "full", // }, vitePlugins: { permalink: true, sidebarOption: { // resolveRule: "rewrites", collapsed: false, // true 开启侧边栏折叠功能,并默认折叠,false 开启侧边栏折叠功能,但是默认不折叠 }, autoFrontmatter: true, autoFrontmatterOption: { permalink: false, permalinkRules: [ // { folderName: "01.guide", rule: "/$path/$uuid6" }, // 使用一级目录的哈希混合随机数,$path 最终等于 guide // { folderName: "10.配置", rule: "/reference/$uuid6" }, // 使用混合固定字符串和随机数 // { folderName: "15.主题开发", rule: "/willRemove/develop/$uuid6", removeLevel: 1 }, // 先移除一层前缀,再添加前缀,等价于 /develop/$uuid6 // { folderName: "20.资源", rule: "/test-$uuid4-$uuid2/aaa/" }, // 使用混合固定字符串和随机数 // { folderName: "30.生态", rule: "/$path-$uuid2/teek/$uuid" }, // 使用一级目录的哈希混合随机数 // // { folderName: "*" }, // '*' 代表所有文件都生成永久链接,不设置 rule 则默认为 /$path/$uuid6 ], categories: false, coverImg: true, // 开启自动生成封面图链接功能 forceCoverImg: false, // 强制重新生成 coverImg 的属性值 coverImgList: wallPapper, // 封面图链接数组 }, }, });