Files
advanced-java/docs/.vitepress/theme/index.ts
Libin YANG 3003dd0267 chore: upgrade deps, migrate theme to TypeScript, and update GitHub Actions (#345)
Align with sibling Doocs projects: add TypeScript tooling, pin GitHub Actions to Node 24-compatible versions, and bump pnpm to v10.
2026-06-25 09:06:50 +08:00

38 lines
881 B
TypeScript

import DefaultTheme from "vitepress/theme";
import giscusTalk from "vitepress-plugin-comment-with-giscus";
import { useData, useRoute } from "vitepress";
import { toRefs } from "vue";
import type { Theme } from "vitepress";
import Layout from "./Layout.vue";
export default {
extends: DefaultTheme,
Layout,
enhanceApp(ctx) {
DefaultTheme.enhanceApp(ctx);
},
setup() {
const { frontmatter } = toRefs(useData());
const route = useRoute();
giscusTalk(
{
repo: "doocs/advanced-java",
repoId: "MDEwOlJlcG9zaXRvcnkxNTE4MzQwNjI=",
mapping: "number",
inputPosition: "top",
lang: "zh-CN",
homePageShowComment: true,
term: "9",
lightTheme: "light",
darkTheme: "transparent_dark",
},
{
frontmatter,
route,
},
true,
);
},
} satisfies Theme;