Skip to content

抽离config配置 原创

场景

随着config.mts文件功能配置越来越多,维护和可复用性差,所以我们需要将一些配置抽离出来,通过抽离配置,代码会变得更清晰、更灵活,同时显著降低维护成本和出错概率

  • docs\.vitepress\config.mts目录下新建config目录,将config.mts文件中的Features.ts FriendLink.ts HitokotoDate.ts Nav.ts SocialDate.ts Wallaper.ts HeadConfig HeadData SocialLinks FooterInfo Comment FooterGroup配置抽离出来
md
.
├─ demo
│ ├─ docs-base
│   ├─ .vitepress
│   │ ├─ config  <- 配置文件夹
│   │ │ └─ Features.ts
│   │ │ └─ FriendLink.ts
│   │ │ └─ HitokotoDate.ts
│   │ │ └─ Nav.ts
│   │ │ └─ Wallaper.ts
│   │ │ └─ Head.ts
│   │ │ └─ SocialLinks.ts
│   │ └─ config.mts  <- 配置文件
│   │ └─ index.ts
│ └─ index.md
  └─ node_modules

Features

  • docs\.vitepress\config.mts文件夹中新建Features.ts文件,将config.mts文件中的Features.ts配置抽离出来
ts
// features用于在首页展示一些功能介绍,也就是首页三个功能块
export const Features = [
  {
    title: "技术",
    description: "技术文章",
    link: "/01.指南/",
    imgUrl: "/img/web.png",
  },
  {
    title: "技术",
    description: "技术文章",
    link: "/01.指南/",
    imgUrl: "/img/web.png",
  },
  {
    title: "技术",
    description: "技术文章",
    link: "/01.指南/",
    imgUrl: "/img/web.png",
  },
];
  • docs\.vitepress\config.mts文件夹中新建FriendLink.ts文件,将config.mts文件中的FriendLink.ts配置抽离出来
ts
// FriendLink用于在首页展示一些友链
export const FriendLink = {
  list: [
    {
      avatar: "/img/bg1.jpg",
      name: "测试1",
      desc: "这是一个友链测试1",
      link: "https://github.com/Kele-Bingtang",
    },
    { avatar: "/img/ui.png", name: "测试2", desc: "这是一个友链测试2222111啊" },
    {
      avatar: "/img/web.png",
      name: "测试3测试3测试3测试3测试3测试3",
      desc: "这是一个友链测试3",
    },
    { avatar: "/img/more.png", name: "测试4", desc: "这是一个友链测试4" },
    { avatar: "/img/ui.png", name: "测试22", desc: "这是一个友链测试2" },
    { avatar: "/img/other.png", name: "测试11", desc: "这是一个友链测试1" },
    { avatar: "/img/more.png", name: "测试44", desc: "这是一个友链测试4" },
    { avatar: "/img/web.png", name: "测试33", desc: "这是一个友链测试3" },
    { avatar: "/img/other.png", name: "测试111", desc: "这是一个友链测试1" },
    { avatar: "/img/web.png", name: "测试333", desc: "这是一个友链测试3" },
    { avatar: "/img/more.png", name: "测试444", desc: "这是一个友链测试4" },
    { avatar: "/img/ui.png", name: "测试222", desc: "这是一个友链测试2" },
  ],
};

HitokotoDate

  • docs\.vitepress\config.mts文件夹中新建HitokotoDate.ts文件,将config.mts文件中的HitokotoDate.ts配置抽离出来
ts
// HitokotoDate一言模块
export const HitokotoDate = [
  // 原有内容保留
  "万般努力只为出人头地,低头弯腰只为爬的更高",

  // 动漫经典语录
  "无论你在哪里,我一定会找到你 —— 星际牛仔",
  "重要的不是你长得漂亮与否,而是你的心灵是否美丽 —— 千与千寻",
  "我们仰望着同一片天空,却看着不同的地方 —— 秒速五厘米",
  "比自己的生命更重要的东西永远存在着 —— fate",
  "正因为生来什么都没有,因此我们能拥有一切 —— 游戏人生",

  // 爱情感悟
  "喜欢一个人就是在对方的一切都合理化",
  "爱,其实很简单,困难的是接受这份简单",
  "最好的爱情是互相成就,而不是互相禁锢",
  "缘分就是,遇见了可以让你笑的人",
  "爱情不是占有,而是彼此成就",

  // 人生哲理
  "生命中最困难的时刻,恰是转机的开始",
  "没有人可以回到过去,但每个人都可以从现在开始",
  "与其等待机会,不如创造机会",
  "生活不会因为你的懦弱而停止脚步",
  "成长的过程总是孤独的,但结果是美好的",

  // 更多动漫台词
  "即使是在最深的黑暗里,也要保持希望 —— 进击的巨人",
  "不要为了别人而活,要为了自己而活 —— 火影忍者",
  "比起悲伤,无法分享快乐才是真的寂寞 —— 四月是你的谎言",
  "梦想是不会结束的,只要还活着就要继续追逐 —— 海贼王",

  // ... 继续添加更多句子直到100个
  "生命的意义不在于活了多久,而在于经历了什么",
  "最珍贵的不是拥有的回忆,而是正在创造的回忆",
  "不要因为走得太远,而忘记了为什么出发",
  "有时候,坚持了你最不想干的事情,却等来了你最想要的结果",
  "与其用泪水悔恨昨天,不如用汗水拼搏今天",

  // 添加更多正能量句子...
  "每个人都是自己人生的主角",
  "不要被周围的声音干扰,坚持自己认定的道路",
  "成功不是终点,失败也不是终结",
  "时间会证明一切,耐心是最好的答案",
  "活在当下,珍惜现在,期待未来",
];
  • docs\.vitepress\config.mts文件夹中新建Nav.ts文件,将config.mts文件中的Nav.ts配置抽离出来

提示 v1.3.4

导航栏图标组件方式:点击跳转

ts
// nav导航栏配置
import {
  TeekIcon,
  VdoingIcon,
  SSLIcon,
  BlogIcon,
  LinuxIcon,
  NginxIcon,
  GitIcon,
  DockerIcon,
  AppstoreIcon,
  PhotoIcon,
  MusicIcon,
  FilmIcon,
  AboutIcon,
  LinkIcon,
  NavIcon,
  SiteAnalyticsIcon,
  StatusIcon,
} from "./icon/NavIcon";
export const Nav = [
  {
    text: "🏡首页",
    items: [
      { text: "首页", link: "/" },
      { text: "起始页", link: "https://hyde.seasir.top/" },
    ],
  },
  {
    text: "📖笔记专栏",
    items: [
      {
        component: "NavIcon",
        props: TeekIcon,
      },
      {
        component: "NavIcon",
        props: VdoingIcon,
      },
      {
        component: "NavIcon",
        props: SSLIcon,
      },
      {
        component: "NavIcon",
        props: BlogIcon,
      },
    ],
  },
  {
    text: "🧰工具资源", // 目录页链接,此处 link 是 vdoing 主题新增的配置项,有二级导航时,可以点击一级导航跳到目录页
    items: [
      {
        component: "NavIcon",
        props: LinuxIcon,
      },
      {
        component: "NavIcon",
        props: NginxIcon,
      },
      {
        component: "NavIcon",
        props: GitIcon,
      },
      {
        component: "NavIcon",
        props: DockerIcon,
      },
      {
        component: "NavIcon",
        props: AppstoreIcon,
      },
    ],
  },
  {
    text: "🏙️生活娱乐",
    items: [
      {
        component: "NavIcon",
        props: PhotoIcon,
      },
      {
        component: "NavIcon",
        props: MusicIcon,
      },
      {
        component: "NavIcon",
        props: FilmIcon,
      },
    ],
  },
  { text: "👂畅所欲言", link: "/message-area/" },
  {
    text: "👏文章索引",
    items: [
      {
        text: "本站",
        items: [
          { text: "文章分类", link: "/categories/" },
          { text: "文章标签", link: "/tags/" },
          { text: "文章归档", link: "/archives/" },
          { text: "文章清单", link: "/articleOverview/" },
          { text: "站点登录", link: "/login/" },
          {
            text: "风险提示",
            link: "/risk-link?target=https://teek.seasir.top/",
          },
        ],
      },
    ],
  },
  {
    text: "🌐站点信息",
    items: [
      {
        component: "NavIcon",
        props: AboutIcon,
      },
      {
        component: "NavIcon",
        props: LinkIcon,
      },
      {
        component: "NavIcon",
        props: NavIcon,
      },
      {
        component: "NavIcon",
        props: SiteAnalyticsIcon,
      },
      {
        component: "NavIcon",
        props: StatusIcon,
      },
    ],
  },
];
ts
import {
  Blog,
  Linux,
  Nginx,
  Git,
  Docker,
  Appstore,
  Photo,
  Music,
  Film,
  About,
  Link,
  Nav,
  SiteAnalytics,
  Status,
} from "./Svgicon";

export const TeekIcon = {
  text: "Teek主题",
  link: "/Teek",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: "https://vp.teek.top/teek-logo-mini.svg",
    iconType: "img",
    // size: 12, // 图标大小
  },
};

export const VdoingIcon = {
  text: "Vdoing主题",
  link: "/Vdoing",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: "https://vuepress.vuejs.org/images/hero.png",
    iconType: "img",
    size: 16, // 图标大小
  },
};

export const SSLIcon = {
  text: "SSL证书",
  link: "/SSL",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: "https://allinssl.com/logo.svg",
    iconType: "img",
    size: 12, // 图标大小
  },
};

export const BlogIcon = {
  text: "博客搭建",
  link: "/Blog",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: Blog,
  },
};

export const NginxIcon = {
  text: "Nginx",
  link: "/Nginx",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: Nginx,
  },
};

export const LinuxIcon = {
  text: "Linux",
  link: "/Linux",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: Linux,
  },
};

export const GitIcon = {
  text: "Git",
  link: "/Git",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: Git,
  },
};

export const DockerIcon = {
  text: "Docker",
  link: "/Docker",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: Docker,
  },
};

export const AppstoreIcon = {
  text: "实用软件",
  link: "/Appstore",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: Appstore,
  },
};

export const PhotoIcon = {
  text: "相册",
  link: "https://photo.seasir.top/",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: Photo,
  },
};

export const MusicIcon = {
  text: "音乐",
  link: "http://music.alger.fun/#/",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: Music,
  },
};

export const FilmIcon = {
  text: "影片",
  link: "/Film",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: Film,
  },
};

export const AboutIcon = {
  text: "关于本站",
  link: "/About",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: About,
  },
  size: 26, // 图标大小
};

export const LinkIcon = {
  text: "友链链接",
  link: "/Link",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: Link,
  },
};

export const NavIcon = {
  text: "网站导航",
  link: "/nav",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: Nav,
  },
};

export const SiteAnalyticsIcon = {
  text: "站点统计",
  link: "https://umami.seasir.top/share/rvVBNZWa0sUCN6wG/teek.seasir.top",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: SiteAnalytics,
  },
};

export const StatusIcon = {
  text: "站点状态",
  link: "https://status.seasir.top/",
  subMenu: true, // 是否有子菜单
  iconProps: {
    icon: Status,
  },
};
ts
const Blog = `<svg t="1748063380189" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4048" width="256" height="256"><path d="M0 0h1024v1024H0z" fill="#5da8ff" opacity=".01" p-id="4049"></path><path d="M795.562667 228.437333A126.037333 126.037333 0 0 1 921.6 354.474667v504.106666c0 34.816-28.202667 63.018667-63.018667 63.018667h-141.568V354.474667c0-69.632 8.96-126.037333 78.549334-126.037334z" fill="#7aaeeb" p-id="4050" data-spm-anchor-id="a313x.search_index.0.i15.1dbc3a81biy5SY" class=""></path><path d="M669.525333 102.4a126.037333 126.037333 0 0 1 126.037334 126.037333v630.186667c0 34.773333 28.202667 62.976 63.018666 62.976H228.394667A126.037333 126.037333 0 0 1 102.4 795.562667V228.437333A126.037333 126.037333 0 0 1 228.437333 102.4z m-220.544 519.893333h-189.013333a47.274667 47.274667 0 1 0 0 94.506667h189.013333a47.274667 47.274667 0 1 0 0-94.506667z m189.013334-189.056h-378.026667a47.274667 47.274667 0 1 0 0 94.506667h378.026667a47.274667 47.274667 0 0 0 0-94.506667zM322.986667 244.224H259.925333a47.274667 47.274667 0 0 0 0 94.464H322.986667a47.274667 47.274667 0 1 0 0-94.506667z" fill="#5da8ff" p-id="4051" data-spm-anchor-id="a313x.search_index.0.i7.1dbc3a81biy5SY" class=""></path></svg>`;

const Linux = `<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256">
	<g fill="none">
		<rect width="256" height="256" fill="#f4f2ed" rx="60" />
		<path fill="#eceff1" d="m85.95 199.926l24.53 13.62h37.096l34.702-26.055l15.556-40.859l-35.899-43.227l-10.171-24.278l-49.66 1.776l.598 13.62l-9.573 17.764l-14.958 29.016l-2.991 24.278z" />
		<path fill="#263238" d="M187.064 114.656c-9.573-13.62-17.351-21.91-21.539-39.082s1.197-12.435-2.393-27.24c-1.795-7.697-4.787-13.027-7.778-17.172c-3.59-4.145-7.778-6.514-10.172-7.106c-5.384-2.96-17.949-7.698-33.505.592c-16.155 8.29-14.36 26.055-11.368 62.177c0 2.368-.599 5.33-1.795 7.698c-2.393 5.33-6.582 10.066-10.171 14.212c-4.189 5.921-8.377 11.843-11.368 18.356c-7.18 13.62-13.762 30.792-11.967 37.306c2.992-.592 40.686 56.255 40.686 57.439c2.393-.592 12.564-.592 21.539-.592c12.565-.592 19.744-1.184 29.916 1.184c0-1.776-.599-3.553-.599-5.329c0-3.553.599-6.514 1.197-10.659c.598-2.961 1.197-5.921 1.795-9.474c-5.983 5.329-16.753 11.251-26.924 13.027c-8.975 1.776-23.933-1.184-31.113-10.067c.599 0 1.795 0 2.394-.592c1.795-.592 3.59-1.184 4.188-2.368c1.795-2.961.598-5.922-.598-7.698c-1.197-1.777-10.172-8.291-14.36-11.843c-4.188-3.553-6.581-5.33-8.975-7.698l-4.786-4.738c-1.197-1.184-1.795-2.368-2.393-2.961c-1.197-2.96-1.795-6.513-1.197-11.25c.598-6.514 2.991-11.844 5.983-17.765c1.197-2.369 4.188-7.106 4.188-7.106s-10.171 24.871-4.786 32.569c0 0 .598-7.698 2.991-15.396c1.795-5.33 4.787-13.028 8.377-17.173s12.564-19.541 13.163-29.016c0-4.145.598-8.29.598-11.25c-2.393-2.37 39.489-8.29 41.882-1.777c.598 2.369 8.975 23.686 13.761 34.937c2.393 5.33 5.385 10.067 7.18 15.988c1.795 6.514 2.991 15.396 2.991 24.279c0 1.776 0 4.737-.598 7.698c1.197 0 24.531-24.871-2.991-45.596c0 0 16.752 7.698 17.351 23.094c.598 12.435-4.787 22.502-5.983 24.278c.598 0 12.564 5.33 13.162 5.33c2.394 0 7.18-1.777 7.18-1.777c.599-1.776 2.393-6.514 2.393-8.29c4.189-13.62-5.983-35.529-15.556-49.149" />
		<path fill="#eceff1" d="M111.078 75.574c4.296 0 7.778-5.303 7.778-11.843c0-6.541-3.482-11.843-7.778-11.843S103.3 57.19 103.3 63.73s3.483 11.843 7.778 11.843m26.924 1.185c5.618 0 10.172-6.098 10.172-13.62S143.62 49.52 138.002 49.52c-5.617 0-10.171 6.098-10.171 13.62s4.554 13.62 10.171 13.62" />
		<path fill="#212121" d="M115.424 64.541c-.497-3.893-2.761-6.817-5.056-6.53s-3.752 3.676-3.254 7.57c.497 3.893 2.76 6.817 5.055 6.53c2.295-.288 3.752-3.677 3.255-7.57m21.981 8.664c3.304 0 5.983-3.446 5.983-7.698c0-4.251-2.679-7.698-5.983-7.698c-3.305 0-5.984 3.447-5.984 7.698s2.679 7.698 5.984 7.698" />
		<path fill="#ffc107" d="M216.98 195.781c-2.393-1.184-6.582-2.961-10.172-8.29c-1.794-2.961-1.196-11.251-4.188-14.804c-1.795-2.368-4.188-1.184-4.786-1.184c-5.385 1.184-17.95 9.474-26.326 0c-1.197-1.184-2.992-2.961-5.983-2.961c-2.992 0-4.188 1.184-5.385 3.553s-1.197 4.145-1.197 10.067c0 4.737 0 10.066-.598 14.211c-1.197 10.067-2.991 15.989-2.991 21.91c0 6.514 1.794 10.659 4.188 12.435c1.795 1.777 4.786 2.961 11.368 2.961c6.581 0 10.769-2.368 14.958-6.514c2.991-2.96 5.384-4.145 13.761-10.066c6.581-4.145 16.753-9.475 18.547-11.251c1.197-1.184 2.992-1.777 2.992-5.33c0-2.96-2.393-4.145-4.188-4.737m-120.261 1.777c-5.983-9.475-6.582-11.251-10.77-17.173c-3.59-5.921-11.368-17.172-16.154-17.172c-3.59 0-5.385 1.776-7.778 4.145c-2.394 2.368-4.787 7.698-8.975 10.659c-3.59 2.96-13.761 2.368-16.154 5.921s2.393 8.883 2.393 17.765c0 3.553-2.992 5.921-3.59 8.29c-.598 2.961-1.197 4.737 0 7.106c2.393 3.553 5.385 4.737 25.727 8.882c10.77 2.369 20.941 8.29 27.523 8.883c6.581.592 17.949 0 17.949-15.989c.599-9.474-4.786-11.843-10.171-21.317m11.368-107.18c-3.59-2.369-6.582-4.738-6.582-8.29c0-3.553 2.394-4.738 5.984-7.698c.598-.593 7.179-6.514 13.761-6.514s14.359 4.145 17.351 5.33c5.385 1.183 10.769 2.368 10.171 6.513c-.598 5.921-1.196 7.106-7.18 10.067c-4.188 1.184-11.966 7.698-17.351 7.698c-2.393 0-5.983 0-8.376-.593c-1.795-.592-4.787-3.553-7.778-6.513" />
		<path fill="#634703" d="M106.89 85.64c1.197 1.185 2.992 2.37 4.787 2.961c1.196.592 2.991 1.185 2.991 1.185h5.385c2.992 0 7.18-1.185 11.368-3.553c4.188-1.777 4.787-2.961 7.778-4.145c2.992-1.777 5.983-3.553 4.787-4.145c-1.197-.593-2.394 0-6.582 2.368c-3.59 2.369-6.581 3.553-10.171 5.33c-1.795.592-4.188 1.776-5.983 1.776h-5.385c-1.795 0-2.992-.592-4.787-1.184c-1.196-.593-1.795-1.185-2.393-1.185c-1.196-.592-3.59-2.96-4.786-3.553c0 0-1.197 0-.599.593zm17.95-13.027c.598 1.184 1.795 1.184 2.393 1.776s1.197.593 1.197.593c.598-.593 0-1.777-.599-1.777c0-1.184-2.991-1.184-2.991-.592m-9.573 1.184c0 .593 1.196 1.185 1.196.593c.599-.593 1.197-1.185 1.795-1.185c1.197-.592.598-1.184-1.196-1.184c-1.197.592-1.197 1.184-1.795 1.776" />
		<path fill="#455a64" d="M173.303 178.609v1.776c1.197 2.369 4.188 2.961 6.581 2.961c3.59 0 7.18-2.369 8.975-4.737c0-.592.598-1.185 1.197-1.777c1.196-1.776 1.795-2.96 2.393-3.553c0 0-.598-.592-.598-1.184c-.599-1.184-2.394-2.369-4.787-2.961c-1.795-.592-4.786-1.184-5.983-1.184c-5.385-.592-8.376 1.184-10.171 2.961c0 0 .598 0 .598.592c1.197 1.184 1.795 2.369 1.795 4.145c.598 1.184 0 1.776 0 2.961" />
	</g>
</svg>`;

const Nginx = `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
	<path fill="#43a047" d="M16 0L2 8v16l14 8l14-8V8Zm8 23a1 1 0 0 1-1 1h-2.52a1 1 0 0 1-.78-.375L12 14v9a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h2.52a1 1 0 0 1 .78.375L20 18V9a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1Z" />
</svg>`;

const Git = `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
	<path fill="#e64a19" d="M13.172 2.828L11.78 4.22l1.91 1.91l2 2A2.986 2.986 0 0 1 20 10.81a3.25 3.25 0 0 1-.31 1.31l2.06 2a2.68 2.68 0 0 1 3.37.57a2.86 2.86 0 0 1 .88 2.117a3.02 3.02 0 0 1-.856 2.109A2.9 2.9 0 0 1 23 19.81a2.93 2.93 0 0 1-2.13-.87a2.694 2.694 0 0 1-.56-3.38l-2-2.06a3 3 0 0 1-.31.12V20a3 3 0 0 1 1.44 1.09a2.92 2.92 0 0 1 .56 1.72a2.88 2.88 0 0 1-.878 2.128a2.98 2.98 0 0 1-2.048.871a2.981 2.981 0 0 1-2.514-4.719A3 3 0 0 1 16 20v-6.38a2.96 2.96 0 0 1-1.44-1.09a2.9 2.9 0 0 1-.56-1.72a2.9 2.9 0 0 1 .31-1.31l-3.9-3.9l-7.579 7.572a4 4 0 0 0-.001 5.658l10.342 10.342a4 4 0 0 0 5.656 0l10.344-10.344a4 4 0 0 0 0-5.656L18.828 2.828a4 4 0 0 0-5.656 0" />
</svg>`;

const Docker = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
	<path fill="#0288d1" d="M21.81 10.25c-.06-.04-.56-.43-1.64-.43c-.28 0-.56.03-.84.08c-.21-1.4-1.38-2.11-1.43-2.14l-.29-.17l-.18.27c-.24.36-.43.77-.51 1.19c-.2.8-.08 1.56.33 2.21c-.49.28-1.29.35-1.46.35H2.62c-.34 0-.62.28-.62.63c0 1.15.18 2.3.58 3.38c.45 1.19 1.13 2.07 2 2.61c.98.6 2.59.94 4.42.94c.79 0 1.61-.07 2.42-.22c1.12-.2 2.2-.59 3.19-1.16A8.3 8.3 0 0 0 16.78 16c1.05-1.17 1.67-2.5 2.12-3.65h.19c1.14 0 1.85-.46 2.24-.85c.26-.24.45-.53.59-.87l.08-.24zm-17.96.99h1.76c.08 0 .16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16H3.85c-.09 0-.16.07-.16.16v1.58c.01.09.07.16.16.16m2.43 0h1.76c.08 0 .16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16H6.28c-.09 0-.16.07-.16.16v1.58c.01.09.07.16.16.16m2.47 0h1.75c.1 0 .17-.07.17-.16V9.5c0-.08-.06-.16-.17-.16H8.75c-.08 0-.15.07-.15.16v1.58c0 .09.06.16.15.16m2.44 0h1.77c.08 0 .15-.07.15-.16V9.5c0-.08-.06-.16-.15-.16h-1.77c-.08 0-.15.07-.15.16v1.58c0 .09.07.16.15.16M6.28 9h1.76c.08 0 .16-.09.16-.18V7.25c0-.09-.07-.16-.16-.16H6.28c-.09 0-.16.06-.16.16v1.57c.01.09.07.18.16.18m2.47 0h1.75c.1 0 .17-.09.17-.18V7.25c0-.09-.06-.16-.17-.16H8.75c-.08 0-.15.06-.15.16v1.57c0 .09.06.18.15.18m2.44 0h1.77c.08 0 .15-.09.15-.18V7.25c0-.09-.07-.16-.15-.16h-1.77c-.08 0-.15.06-.15.16v1.57c0 .09.07.18.15.18m0-2.28h1.77c.08 0 .15-.07.15-.16V5c0-.1-.07-.17-.15-.17h-1.77c-.08 0-.15.06-.15.17v1.56c0 .08.07.16.15.16m2.46 4.52h1.76c.09 0 .16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16h-1.76c-.08 0-.15.07-.15.16v1.58c0 .09.07.16.15.16" />
</svg>`;

const Appstore = `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
	<path fill="#5da8ff" d="M2.02 1.515a.505.505 0 0 0-.505.505v5.05c0 .28.226.506.505.506h5.05a.505.505 0 0 0 .506-.505V2.02a.505.505 0 0 0-.505-.506zm5.05 9.394a2.02 2.02 0 0 1 2.02 2.02v5.05A2.02 2.02 0 0 1 7.07 20H2.02A2.02 2.02 0 0 1 0 17.98v-5.05a2.02 2.02 0 0 1 2.02-2.02zm10.91 0A2.02 2.02 0 0 1 20 12.93v5.05A2.02 2.02 0 0 1 17.98 20h-5.05a2.02 2.02 0 0 1-2.02-2.02v-5.05a2.02 2.02 0 0 1 2.02-2.02zM7.07 12.424H2.02a.505.505 0 0 0-.505.505v5.05c0 .28.226.506.505.506h5.05a.505.505 0 0 0 .506-.505v-5.05a.505.505 0 0 0-.505-.506m10.91 0h-5.05a.505.505 0 0 0-.506.505v5.05c0 .28.226.506.505.506h5.05a.505.505 0 0 0 .506-.505v-5.05a.505.505 0 0 0-.505-.506M7.07 0a2.02 2.02 0 0 1 2.02 2.02v5.05a2.02 2.02 0 0 1-2.02 2.02H2.02A2.02 2.02 0 0 1 0 7.07V2.02A2.02 2.02 0 0 1 2.02 0zm10.91 0A2.02 2.02 0 0 1 20 2.02v5.05a2.02 2.02 0 0 1-2.02 2.02h-5.05a2.02 2.02 0 0 1-2.02-2.02V2.02A2.02 2.02 0 0 1 12.93 0zm0 1.515h-5.05a.505.505 0 0 0-.506.505v5.05c0 .28.226.506.505.506h5.05a.505.505 0 0 0 .506-.505V2.02a.505.505 0 0 0-.505-.506" stroke-width="0.5" stroke="#5da8ff" />
</svg>`;

const Photo = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
	<g fill="none">
		<path stroke="#5da8ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M20.33 17.657c.11-.366.17-.755.17-1.157v-9a4 4 0 0 0-4-4h-9a4 4 0 0 0-4 4v9.07m16.83 1.087l-.088-.104l-2.466-2.976a2 2 0 0 0-3.073-.008l-1.312 1.566l-.214.261m7.153 1.26a4 4 0 0 1-3.713 2.842m0 0l-.117.002h-9a4 4 0 0 1-4-3.93m13.117 3.928l-.093-.106l-3.347-3.996m-9.676.175l.177-.201l3.206-3.827a2 2 0 0 1 3.066 0l3.227 3.853" />
		<circle cx="15.091" cy="8.909" r="1.5" fill="#5da8ff" />
	</g>
</svg>`;

const Music = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
	<g fill="#86adff">
		<path d="M11 13.75a.75.75 0 1 1 0 1.5a.75.75 0 0 1 0-1.5" />
		<path d="M9.367 2.25c-1.092 0-1.958 0-2.655.057c-.714.058-1.317.18-1.868.46a4.75 4.75 0 0 0-2.076 2.077c-.281.55-.403 1.154-.461 1.868c-.057.697-.057 1.563-.057 2.655v5.266c0 1.092 0 1.958.057 2.655c.058.714.18 1.317.46 1.869a4.75 4.75 0 0 0 2.077 2.075c.55.281 1.154.403 1.868.461c.697.057 1.563.057 2.655.057h5.266c1.092 0 1.958 0 2.655-.057c.714-.058 1.317-.18 1.869-.46a4.75 4.75 0 0 0 2.075-2.076c.281-.552.403-1.155.461-1.869c.057-.697.057-1.563.057-2.655V9.367c0-1.092 0-1.958-.057-2.655c-.058-.714-.18-1.317-.46-1.868a4.75 4.75 0 0 0-2.076-2.076c-.552-.281-1.155-.403-1.869-.461c-.697-.057-1.563-.057-2.655-.057zm5.133 6.5h-1.25v5.75a2.25 2.25 0 1 1-1.5-2.122V8.6c0-.746.604-1.35 1.35-1.35h1.4a.75.75 0 0 1 0 1.5" />
	</g>
</svg>`;

const Film = `<svg t="1748392735697" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10973" width="256" height="256"><path d="M904 848H120c-30.93 0-56-25.07-56-56V232c0-30.93 25.07-56 56-56h784c30.93 0 56 25.07 56 56v560c0 30.93-25.07 56-56 56z" fill="#8C9EFF" p-id="10974"></path><path d="M64 792c0 30.93 25.07 56 56 56h84V680H64v112z" fill="#E1F5FF" p-id="10975" data-spm-anchor-id="a313x.search_index.0.i24.583b3a81r1QqqT" class="selected"></path><path d="M120 176c-30.93 0-56 25.07-56 56v112h140V176h-84z" fill="#7aaeeb" p-id="10976" data-spm-anchor-id="a313x.search_index.0.i20.583b3a81r1QqqT" class="selected"></path><path d="M64 344h140v168H64z" fill="#E1F5FF" p-id="10977" data-spm-anchor-id="a313x.search_index.0.i25.583b3a81r1QqqT" class="selected"></path><path d="M64 512h140v168H64z" fill="#7aaeeb" p-id="10978" data-spm-anchor-id="a313x.search_index.0.i21.583b3a81r1QqqT" class="selected"></path><path d="M819.21 848h84c30.93 0 56-25.07 56-56V680h-140v168z" fill="#E1F5FF" p-id="10979" data-spm-anchor-id="a313x.search_index.0.i23.583b3a81r1QqqT" class="selected"></path><path d="M903.21 176h-84v168h140V232c0-30.93-25.07-56-56-56z" fill="#7aaeeb" p-id="10980" data-spm-anchor-id="a313x.search_index.0.i19.583b3a81r1QqqT" class="selected"></path><path d="M819.21 344h140v168h-140z" fill="#E1F5FF" p-id="10981" data-spm-anchor-id="a313x.search_index.0.i22.583b3a81r1QqqT" class="selected"></path><path d="M819.21 512h140v168h-140z" fill="#7aaeeb" p-id="10982" data-spm-anchor-id="a313x.search_index.0.i18.583b3a81r1QqqT" class="selected"></path><path d="M619.24 536.25l-158.49 91.5c-18.67 10.78-42-2.69-42-24.25v-183c0-21.55 23.33-35.03 42-24.25l158.49 91.5c18.67 10.78 18.67 37.72 0 48.5z" fill="#FFD600" p-id="10983"></path></svg>`;

const About = `<svg t="1748393240929" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="18839" width="256" height="256"><path d="M512 0Q373.80531 0 253.734513 70.230088 138.19469 138.19469 70.230088 253.734513 0 372.672566 0 512t70.230088 258.265487q67.964602 115.539823 183.504425 183.504425 120.070796 70.230088 258.831859 70.230088T770.265487 953.769912q116.672566-67.964602 183.504425-183.504425 70.230088-118.938053 70.230088-258.265487t-70.230088-258.265487Q886.938053 138.19469 770.265487 70.230088 651.327434 0 512 0z m0 968.495575q-123.469027 0-229.946903-62.300885-103.079646-60.035398-164.247787-163.115044-62.300885-106.477876-62.300885-230.513274T117.80531 282.053097q61.168142-103.079646 164.247787-164.247787 106.477876-62.300885 230.513275-62.300885T743.079646 117.80531q103.079646 61.168142 163.115044 164.247787 62.300885 106.477876 62.300885 230.513275T906.19469 743.079646q-60.035398 103.079646-163.115044 163.115044-106.477876 62.300885-231.079646 62.300885z m0-695.504425q-15.858407 18.123894-15.858407 43.044248 0 20.389381 13.026549 33.982301t33.415929 13.59292q22.654867 0 39.646017-18.690265t16.991151-42.477876q0-20.389381-13.59292-34.548673T549.946903 254.867257q-22.088496 1.132743-37.946903 18.123893z m39.646018 340.955753q-15.858407 15.858407-29.451328 26.053097 6.79646-32.849558 31.716814-116.672566 20.389381-71.362832 20.389381-82.690266 0-14.725664-11.327434-24.353982t-31.716814-7.929204q-20.389381 1.699115-46.442478 16.424779-27.185841 15.858407-61.168141 53.238938l-12.460177 12.460177 39.646017 30.584071 32.849558-31.716814q-44.176991 144.99115-44.176991 185.769911 0 18.123894 10.761062 30.017699t28.318584 11.893806q17.557522 0 41.345133-12.460177 21.522124-12.460177 66.831858-55.504425l12.460177-11.327434-35.115044-35.115044z" p-id="18840" fill="#7aaeeb"></path></svg>`;

const Link = `<svg t="1748156239695" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="27189" width="256" height="256"><path d="M0 0h1024v1024H0z" fill="#ffffff00" p-id="27190"></path><path d="M361.376 617.376a32 32 0 0 0 45.248 45.248l-45.248-45.248z m301.248-210.752a32 32 0 0 0-45.248-45.248l45.248 45.248zM622.72 147.552l-22.624-22.624 22.624 22.624z m248.896 248.896l-22.624-22.624 22.624 22.624z m-402.24-140.8a32 32 0 1 0 45.216 45.28L469.344 255.68z m-72.928 616l-22.624-22.656 22.624 22.624z m-248.896 0l22.624-22.656-22.624 22.624z m0-248.928l22.624 22.624-22.624-22.624z m402.592 140.48a32 32 0 0 0-45.248-45.28l45.248 45.248z m197.024-287.552a32 32 0 1 0 45.28 45.248l-45.28-45.248zM294.624 520.896a32 32 0 1 0-45.248-45.248l45.248 45.248z m112 141.76l256-256-45.248-45.28-256 256 45.248 45.248z m238.72-492.48a144 144 0 0 1 203.648 0l45.248-45.248a208 208 0 0 0-294.144 0l45.248 45.248z m203.648 0a144 144 0 0 1 0 203.648l45.248 45.248a208 208 0 0 0 0-294.144l-45.248 45.248z m-248.896-45.248L469.344 255.68l45.248 45.248 130.752-130.752-45.248-45.248zM373.824 848.96a144 144 0 0 1-203.648 0l-45.248 45.28a208 208 0 0 0 294.144 0l-45.248-45.28z m-203.648 0a144 144 0 0 1 0-203.648l-45.248-45.248a208 208 0 0 0 0 294.144l45.248-45.248z m248.896 45.28l131.072-131.104-45.248-45.248-131.072 131.072 45.248 45.28z m429.92-520.448l-101.824 101.824 45.28 45.248 101.792-101.824-45.248-45.248zM170.176 645.344l124.48-124.448-45.28-45.248-124.48 124.48 45.28 45.216z" fill="#7aaeeb" p-id="27191"></path></svg>`;

const Nav = `<svg t="1748156505578" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="32184" width="256" height="256"><path d="M0 0h1024v1024H0z" fill="#7aaeeb" fill-opacity="0" p-id="32185"></path><path d="M587.562667 896l-2.474667-0.085333a43.52 43.52 0 0 1-39.68-32.064l-82.773333-300.949334-302.656-84.373333a43.626667 43.626667 0 0 1-31.914667-39.957333 43.669333 43.669333 0 0 1 27.797333-42.922667L836.416 130.986667a43.733333 43.733333 0 0 1 56.618667 56.618666l-264.725334 680.533334A44.010667 44.010667 0 0 1 587.562667 896zM203.136 434.858667l303.168 84.522666 82.88 301.290667L834.816 189.162667 203.136 434.858667z" fill="#7aaeeb" fill-opacity=".65" p-id="32186"></path></svg>`;

const SiteAnalytics = `<svg t="1748156803600" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="38235" width="256" height="256"><path d="M170.666667 85.333333v768h768v85.333334H85.333333V85.333333h85.333334z m512 170.666667h256v256h-85.333334V402.048l-67.370666 67.2a203957.589333 203957.589333 0 0 0-115.797334 115.541333l-30.165333 30.165334-170.666667-170.666667-213.333333 213.333333L195.669333 597.333333 469.333333 323.626667l170.666667 170.666666 85.717333-85.461333L793.344 341.333333H682.666667V256z" fill="#7aaeeb" p-id="38236"></path></svg>`;

const Status = `<svg t="1748156926781" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="40271" width="256" height="256"><path d="M800.256 756.736H215.722667a68.266667 68.266667 0 0 1-68.266667-68.266667V235.52a68.266667 68.266667 0 0 1 68.266667-68.266667h584.533333a68.266667 68.266667 0 0 1 68.266667 68.266667v452.778667a68.266667 68.266667 0 0 1-68.266667 68.437333zM215.722667 219.648a15.701333 15.701333 0 0 0-15.701334 15.701333v452.949334a15.872 15.872 0 0 0 15.701334 15.872h584.533333a15.872 15.872 0 0 0 15.872-15.872V235.52a15.872 15.872 0 0 0-15.872-15.872z" fill="#7aaeeb" p-id="40272"></path><path d="M676.522667 851.626667H339.456a26.453333 26.453333 0 0 1 0-52.736h337.066667a26.453333 26.453333 0 1 1 0 52.736z" fill="#7aaeeb" p-id="40273"></path><path d="M563.2 582.997333h-3.072a26.453333 26.453333 0 0 1-21.504-17.066666l-71.68-186.368-76.288 127.829333a26.453333 26.453333 0 0 1-22.528 12.8h-85.333333a26.453333 26.453333 0 0 1 0-52.736h69.632l96.256-161.28a26.453333 26.453333 0 0 1 36.181333-9.045333 26.624 26.624 0 0 1 11.093333 12.970666l73.898667 190.805334 28.842667-41.472a26.282667 26.282667 0 0 1 21.674666-11.434667h111.616a26.453333 26.453333 0 0 1 0 52.736H634.88l-49.322667 70.997333a26.453333 26.453333 0 0 1-22.357333 11.264z" fill="#7aaeeb" p-id="40274"></path></svg>`;

export {
  Blog,
  Linux,
  Nginx,
  Git,
  Docker,
  Appstore,
  Photo,
  Music,
  Film,
  About,
  Link,
  Nav,
  SiteAnalytics,
  Status,
};

SocialDate

  • docs\.vitepress\config.mts文件夹中新建SocialDate.ts文件,将config.mts文件中的SocialDate.ts配置抽离出来
ts
// 卡片栏社交信息
import { Social } from "vitepress-theme-Teek/config";

export const SocialDate: Social[] = [
  {
    icon: "icon-github",
    iconType: "iconfont",
    name: "GitHub",
    link: "https://github.com/kele-bingtang",
  },
  {
    icon: "icon-gitee2",
    iconType: "iconfont",
    name: "Gitee",
    link: "https://gitee.com/SeasirHyde/vitepress-theme-Teek-hyde",
  },
  {
    icon: "icon-qq",
    iconType: "iconfont",
    name: "QQ",
    link: "http://wpa.qq.com/msgrd?v=3&uin=28761025&site=qq&menu=yes",
  },
  {
    icon: "icon-mobile",
    iconType: "iconfont",
    name: "联系我",
    link: "https://www.youngkbt.cn/?contact=true",
  },
];

Wallaper

  • docs\.vitepress\config.mts文件夹中新建Wallaper.ts文件,将config.mts文件中的Wallaper.ts配置抽离出来
ts
// 首页壁纸
export const Wallpaper = [
  "/home/bg1.webp",
  "/home/bg2.webp",
  "/home/bg3.webp",
  "/home/bg4.webp",
  "/home/bg5.webp",
  "/home/bg6.webp",
  "/home/bg7.webp",
  "/home/bg8.webp",
  "/home/bg9.webp",
  "/home/bg10.webp",
  "/home/bg11.webp",
  "/home/bg12.webp",
  "/home/bg13.webp",
  "/home/bg14.webp",
  "/home/bg15.webp",
  "/home/bg16.webp",
  "/home/bg17.webp",
  "/home/bg18.webp",
  "/home/bg19.webp",
  "/home/bg20.webp",
  "/home/bg21.webp",
  "/home/bg22.webp",
  "/home/bg23.webp",
  "/home/bg24.webp",
  "/home/bg25.webp",
  "/home/bg26.webp",
  "/home/bg27.webp",
  "/home/bg28.webp",
  "/home/bg29.webp",
  "/home/bg30.webp",
  "/home/bg31.webp",
];
  • docs\.vitepress\config\Head.ts文件中添加Head.ts配置
ts
const description = ["Hd Security 使用文档", "认证框架"].toString();

// 导出head.ts
export const HeadData = [
  // 51.la数据挂件
  [
    "script",
    {
      charset: "UTF-8",
      id: "LA_COLLECT",
      src: "//sdk.51.la/js-sdk-pro.min.js",
      defer: "defer",
    },
  ],
  [
    "script",
    { defer: "defer" },
    `LA.init({id:"3LmDV843SgGyC2Zp",ck:"3LmDV843SgGyC2Zp",autoTrack:true,hashMode:true,screenRecord:true})`,
  ],
  ["meta", { name: "referrer", content: "no-referrer-when-downgrade" }], //不蒜子统计
  ["meta", { name: "author", content: "Tianke" }],
  [
    "meta",
    {
      name: "viewport",
      content:
        "width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no",
    },
  ],
  [
    "meta",
    {
      name: "description",
      description,
    },
  ],
  ["meta", { name: "keywords", description }],
  ["link", { rel: "icon", href: "/favicon.ico", type: "image/png" }],
  // 阿里在线矢量库
  [
    "link",
    {
      rel: "stylesheet",
      href: "//at.alicdn.com/t/font_2989306_w303erbip9.css",
    },
  ],
  [
    // 阿里图标库symbol 引用
    "script",
    {
      src: "https://at.alicdn.com/t/c/font_4899452_xj7acblxpxj.js",
      media: "print",
      onload: "this.media='all'",
    },
  ],
  // umami统计
  [
    "script",
    {
      src: "https://umami.seasir.top/script.js",
      "data-website-id": "aa519ead-42bb-4f0c-96b5-0ccf630f82be",
      defer: "defer",
    },
  ],
  //免费的音乐播放器
  // [
  //   "script",
  //   {
  //     type: "text/javascript",
  //     src: "https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js",
  //     defer: "defer", // 添加defer属性,确保脚本在DOM加载完成后执行
  //   },
  // ], // 插入自定义脚本
  // [
  //   "script",
  //   {
  //     type: "text/javascript",
  //     id: "myhk",
  //     src: "https://myhkw.cn/api/player/174131850675",
  //     key: "174131850675",
  //     m: "",
  //     defer: "defer", // 添加defer属性,确保脚本在DOM加载完成后执行
  //   },
  // ],
];
ts
/* docs\.vitepress\theme\icon */

const gitee = `<svg t="1743875298298" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2388" width="200" height="200"><path d="M512 1024C229.2224 1024 0 794.7776 0 512S229.2224 0 512 0s512 229.2224 512 512-229.2224 512-512 512z m259.1488-568.8832H480.4096a25.2928 25.2928 0 0 0-25.2928 25.2928l-0.0256 63.2064c0 13.952 11.3152 25.2928 25.2672 25.2928h177.024c13.9776 0 25.2928 11.3152 25.2928 25.2672v12.6464a75.8528 75.8528 0 0 1-75.8528 75.8528H366.592a25.2928 25.2928 0 0 1-25.2672-25.2928v-240.1792a75.8528 75.8528 0 0 1 75.8272-75.8528h353.9456a25.2928 25.2928 0 0 0 25.2672-25.2928l0.0768-63.2064a25.2928 25.2928 0 0 0-25.2672-25.2928H417.152a189.6192 189.6192 0 0 0-189.6192 189.6448v353.9456c0 13.9776 11.3152 25.2928 25.2928 25.2928h372.9408a170.6496 170.6496 0 0 0 170.6496-170.6496v-145.408a25.2928 25.2928 0 0 0-25.2928-25.2672z" fill="#C71D23" p-id="2389"></path></svg>`;

const email = `<svg t="1743875620187" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16697" width="200" height="200"><path d="M512 0A512 512 0 1 1 0 512 512 512 0 0 1 512 0z" fill="#ff485f" p-id="16698" data-spm-anchor-id="a313x.search_index.0.i13.70183a81yTylfI" class="selected"></path><path d="M726.980923 295.384615H280.123077A63.606154 63.606154 0 0 0 216.615385 358.892308v295.187692a63.606154 63.606154 0 0 0 63.507692 63.507692h446.857846a63.606154 63.606154 0 0 0 63.507692-63.507692v-295.187692A63.606154 63.606154 0 0 0 726.980923 295.384615z m25.403077 358.715077a25.481846 25.481846 0 0 1-25.403077 25.403077H280.123077a25.481846 25.481846 0 0 1-25.403077-25.403077v-295.187692a25.481846 25.481846 0 0 1 25.403077-25.403077h446.857846a25.481846 25.481846 0 0 1 25.403077 25.403077z" fill="#FFFFFF" p-id="16699"></path><path d="M693.720615 396.307692l-190.148923 119.965539-190.148923-119.965539a19.062154 19.062154 0 0 0-20.322461 32.236308l200.073846 126.247385a19.062154 19.062154 0 0 0 10.161231 2.934153h0.630153a19.062154 19.062154 0 0 0 10.161231-2.934153l200.073846-126.247385a19.101538 19.101538 0 1 0-20.48-32.236308z" fill="#FFFFFF" p-id="16700"></path></svg>`;

const WhatsApp = `<svg t="1743875749604" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="20479" width="200" height="200"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#1BD741" p-id="20480"></path><path d="M760.2 269.5c-62.1-61.4-144.6-95.2-232.5-95.2-181.1 0-328.5 145.7-328.5 324.8 0 57.2 15.1 113.2 43.9 162.3l-46.6 168.3 174.2-45.2c48.2 25.9 102.1 39.5 157 39.6h0.1c181.1 0 328.6-145.7 328.6-324.8 0.1-86.8-34.1-168.3-96.2-229.8zM527.8 769.3c-49 0-97-13-139.1-37.6l-10-5.9-103.4 26.7 27.6-99.6-6.5-10.2c-27.4-43-42-92.8-41.8-143.6 0-148.9 122.5-270 273.3-270 72.9 0 141.6 28.2 193.2 79.1 51.4 50.6 80.1 119.3 79.9 191-0.1 149-122.6 270.1-273.2 270.1zM677.6 567c-8.2-4.1-48.6-23.7-56.1-26.4-7.5-2.7-13-4.1-18.5 4.1-5.4 8.1-21.2 26.4-26 31.9-4.8 5.4-9.6 6.1-17.7 2.1-8.2-4.1-34.7-12.7-66.1-40.3-24.4-21.5-40.9-48.1-45.7-56.2-4.8-8.1-0.5-12.6 3.6-16.5 3.8-3.6 8.2-9.5 12.3-14.2 4.1-4.7 5.4-8.1 8.2-13.6 2.7-5.4 1.4-10.1-0.6-14.2-2.1-4.1-18.5-44-25.3-60.3-6.6-15.9-13.5-13.7-18.5-13.9-4.8-0.2-10.2-0.2-15.7-0.2-5.4 0-14.4 2-21.9 10.1-7.5 8.1-28.7 27.8-28.7 67.7 0 39.9 29.4 78.5 33.6 84 4.1 5.4 57.9 87.4 140.3 122.5 19.6 8.3 34.8 13.3 46.8 17.1 19.7 6.1 37.6 5.2 51.7 3.2 15.8-2.3 48.6-19.6 55.4-38.5 6.9-18.9 6.9-35.2 4.8-38.5-2.1-3.7-7.6-5.8-15.9-9.9z m0 0" fill="#FFFFFF" p-id="20481"></path></svg>`;

const telegram = `<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" viewBox="0 0 24 24">
  <circle cx="12" cy="12" r="12" fill="#039be5"></circle>
  <path fill="#fff" d="m5.491 11.74 11.57-4.461c.537-.194 1.006.131.832.943l.001-.001-1.97 9.281c-.146.658-.537.818-1.084.508l-3-2.211-1.447 1.394c-.16.16-.295.295-.605.295l.213-3.053 5.56-5.023c.242-.213-.054-.333-.373-.121l-6.871 4.326-2.962-.924c-.643-.204-.657-.643.136-.953z"></path>
</svg>`;

export { gitee, email, WhatsApp, telegram };
ts
/* docs\.vitepress\ConfigHyde\SocialLinks.ts */

import { gitee, email, WhatsApp, telegram } from "../theme/icon/icons";

export const SocialLinks = [
  {
    icon: { svg: gitee },
    link: "https://gitee.com/SeasirHyde/teek-hyde",
  },
  {
    icon: { svg: email },
    link: "mailto:seasir666@gmail.com",
  },
  {
    icon: { svg: WhatsApp },
    link: "https://api.whatsapp.com/send/?phone=13527063419&text=Hello",
  },
  {
    icon: { svg: telegram },
    link: "https://t.me/seasir_Bot",
  },
  {
    icon: "github",
    link: "https://github.com/Kele-Bingtang/vitepress-theme-teek/tree/dev",
  },
];

FooterInfo

注意

ts
/*  docs\.vitepress\ConfigHyde\FooterInfo.ts */

// 底部信息配置
import { version } from "vitepress-theme-teek/es/version"; // 导入版本号

export const FooterInfo = {
  topMessage: [
    `<span><img alt="VitePress" src="https://liuyuyang.net/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fanimals.65eaf6e3.webp&w=750&q=75"><span/>`,

    `<a target="_blank" href="https://vitepress.dev/" title="本站框架基于 VitePress_v1.6.3" ><img alt="VitePress" src="https://img.shields.io/badge/Frame-VitePress-4868C2?logo=vitepress&amp;logoColor=fff" ></a>
    <a target="_blank" href="https://twikoo.js.org/" title="本站评论系统使用 Twikoo" ><img alt="Twikoo" src="https://img.shields.io/badge/Comments-Twikoo-0072F9"></a>

    <a target="_blank" href="http://creativecommons.org/licenses/by-nc-sa/4.0/" title="本站内容采用 CC BY-NC-SA 4.0 国际许可协议进行许可"><img alt="Copyright" src="https://img.shields.io/badge/Copyright-BY--NC--SA%204.0-d42328?logo=coursera&amp;logoColor=fff"></a>
    <a target="_blank" href="https://www.algolia.com/" title="本站搜索服务使用 Algolia"><img alt="Algolia" src="https://img.shields.io/badge/Search-Algolia-3095FA?logo=Algolia"></a>

    <a target="_blank" href="https://www.aliyun.com/" title="本站部署服务使用 Aliyun"><img alt="Aliyun" src="https://img.shields.io/badge/Alibaba-Cloud?logo=alibabacloud&label=Server&color=%23FF6A00"></a>
    <a target="_blank" href="https://umami.is/" title="本站统计服务使用 Umami"><img alt="Umami" src="https://img.shields.io/badge/umami-000000?logo=umami&label=Count&color=%23000000"></a>
    <a target="_blank" href="https://nginx.org/" title="本站Nginx反向代理服务 Nginx"><img alt="Nginx" src="https://img.shields.io/badge/Nginx-Proxy?logo=Nginx&label=Proxy"></a>`,
  ],
  theme: {
    name: `Theme By Teek@${version}-2025.5.7`,
  },
  bottomMessage: [
    `<script id="LA-DATA-WIDGET" crossorigin="anonymous" charset="UTF-8" src="https://v6-widget.51.la/v6/3LmDV843SgGyC2Zp/quote.js?theme=0&f=12&display=0,1,1,1,1,1,1,1"></script>`,
    `<span id="runtime"></span>`,
    `<a href="https://51.la/" target="_blank" style="display:flex;align-items:center;justify-content:center;">本网站由51.LA <img src="https://51.la/favicon.ico" style="width:16px;height:16px;" alt="51.LA"> 提供数据统计服务</a>`,
    "人心中的成见是一座大山~",
  ],
  copyright: {
    createYear: 2021,
    suffix: "Hyde Blog",
  },
  icpRecord: {
    name: "桂ICP备2021009994号",
    link: "http://beian.miit.gov.cn/",
  },
  // 网络安全备案信息配置
  securityRecord: {
    name: "甘公网安备62102702000211号",
    link: "https://beian.mps.gov.cn/",
  },
  customHtml: ``, // 搭配 ./theme/hooks/useRuntime.ts
};
scss
/* docs\.vitepress\theme\style\var.scss */

/* 页脚微章居中 */
.tk-footer-info p {
  display: flex;
  justify-content: center;
}

/* 移动端页脚微章布局 */
@media (max-width: 768px) {
  .tk-footer-info p {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    font-weight: 500;
  }

  .tk-footer-info p a {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.2rem;
  }
}

/* 页脚微章图片 */
.tk-footer-info p img {
  margin-left: 10px;
}

Comment

  • docs\.vitepress\ConfigHyde文件夹中创建Comment.ts文件
ts
// 评论配置
export const CommentData = {
  // twikoo 配置,官网:https://twikoo.js.org/
  envId: "https://twikoo.seasir.top/",
  link: "https://cdn.jsdelivr.net/npm/twikoo@1.6.41/dist/twikoo.all.min.js",

  // waline 配置,官网:https://waline.js.org/
  // serverURL: "https://tk.waline.youngkbt.cn/",
  // jsLink: "https://unpkg.com/@waline/client@v3/dist/waline.js",
  // cssLink: "https://unpkg.com/@waline/client@v3/dist/waline.css",

  // giscus 配置,官网:https://giscus.app/zh-CN
  // repo: "Kele-Bingtang/vitepress-theme-teek",
  // repoId: "R_kgDONpVfBA",
  // category: "Announcements",
  // categoryId: "DIC_kwDONpVfBM4Cm3v9",

  // artalk 配置,官网:https://artalk.js.org/
  // server: "",
  // site: "",
};

FooterGroup

  • docs\.vitepress\ConfigHyde文件夹中创建FooterGroup.ts文件
ts
// 页脚信息组配置
export const FooterGroup = [
  {
    title: "博客",
    links: [
      { name: "全部分类", link: "/categories" },
      { name: "全部标签", link: "/tags" },
      { name: "文章归档", link: "/archivesPage" },
      { name: "全部清单", link: "/articleOverview" },
    ],
  },
  {
    title: "专栏",
    links: [
      { name: "TeeK 主题", link: "/Teek" },
      { name: "Vdoing主题", link: "/Vdoing/" },
      { name: "SSL证书", link: "/SSL" },
    ],
  },
  {
    title: "页面",
    links: [
      { name: "畅所欲言", link: "/message-area/" },
      { name: "关于本站", link: "/about-website/" },
    ],
  },
  {
    title: "服务",
    links: [
      {
        name: "站点统计",
        link: "https://umami.seasir.top/share/rvVBNZWa0sUCN6wG/teek.seasir.top",
      },
      { name: "站点状态", link: "https://status.seasir.top/" },
    ],
  },
];

配置

  • docs\.vitepress\config.mts文件中引入Features.ts FriendLink.ts HitokotoDate.ts Nav.ts SocialDate.ts Wallaper.ts HeadConfig HeadData SocialLinks FooterInfo Comment FooterGroup配置
ts
import { Features } from "./config/Features"; // 导入Features模块
import { FriendLink } from "./config/FriendLink"; // 导入FriendLink模块
import { HitokotoDate } from "./config/HitokotoDate"; // 导入HitokotoDate模块
import { Nav } from "./config/Nav"; // 导入Nav模块
import { SocialDate } from "./config/SocialDate"; // 导入SocialDate社交信息模块
import { Wallpaper } from "./config/Wallaper"; // 导入Wallaper模块
import type { HeadConfig } from "vitepress"; // 在文件顶部添加类型导入
import { HeadData } from "./config/Head"; // 导入 HeadData 导入和类型断言
import { SocialLinks } from "./config/SocialLinks"; //导入社交链接配置
import { FooterGroup } from "./ConfigHyde/FooterGroup"; //导入页脚信息组配置

const tkConfig = tkThemeConfig ({
  // 其他配置...
  banner: {
    features: Features, //用于在首页展示一些功能介绍,也就是首页三个功能块
    imgSrc: Wallpaper, // Banner 大图
    description: HitokotoDate, // 打字机描述信息
    // banner配置项...
  },
  friendLink: FriendLink, // 友链配置
  social: SocialDate, //社交信息配置
  FooterGroup: FooterGroup, // 页脚信息组配置
})

export default defineConfig({
  // 其他配置...
  head: HeadData as HeadConfig[], // HeadData
  themeConfig: {
    nav: Nav,  // 导航栏配置
    socialLinks: SocialLinks, // 社交链接配置
  },
})
最近更新