test webhook

This commit is contained in:
锦恢 2025-05-29 18:02:08 +08:00
parent fc0eb09fbd
commit 25d996c1a7
7 changed files with 227 additions and 28 deletions

View File

@ -6,6 +6,10 @@ import {
GitChangelogMarkdownSection,
} from '@nolebase/vitepress-plugin-git-changelog/vite';
import {
InlineLinkPreviewElementTransform
} from '@nolebase/vitepress-plugin-inline-link-preview/markdown-it';
export const customIcons = {
share: {
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z"/></svg>'
@ -20,20 +24,36 @@ export default defineConfig({
base: baseUrl,
ignoreDeadLinks: true,
markdown: {
config: (md) => {
md.use(lightbox, {});
}
sitemap: {
hostname: 'https://kirigaya.cn/' + baseUrl
},
vite: {
plugins: [
GitChangelog({
// Fill in your repository URL here
// 填写在此处填写您的仓库链接
repoURL: () => 'https://gitea.3geeks.top/kirigaya/openmcp-document',
}),
GitChangelogMarkdownSection(),
],
optimizeDeps: {
exclude: [
'@nolebase/vitepress-plugin-inline-link-preview/client',
],
},
ssr: {
noExternal: [
// 如果还有别的依赖需要添加的话,并排填写和配置到这里即可 //
'@nolebase/vitepress-plugin-inline-link-preview',
],
},
},
markdown: {
config: (md) => {
md.use(lightbox);
md.use(InlineLinkPreviewElementTransform);
}
},
head: [

View File

@ -1,7 +1,9 @@
<template>
<DefaultTheme.Layout id="k-layout" />
<DefaultTheme.Layout id="k-layout">
</DefaultTheme.Layout>
</template>
<script setup lang="ts">
@ -53,7 +55,7 @@ const handleRouteChangeStart = async (to: string) => {
const from = router.route.path;
if (sameSource(from, to)) {
await animateIn('VPContent', { name: 'fade' });
await animateIn('VPContent', { name: 'slide', durationMs: 200 });
} else {
await animateIn('k-layout', { name: 'fade' });
}
@ -61,7 +63,7 @@ const handleRouteChangeStart = async (to: string) => {
const handleRouteChangeComplete = async (to: string) => {
await animateOut({ name: 'fade' });
await animateOut();
setupMediumZoom();
};
@ -92,27 +94,20 @@ onMounted(() => {
/* 淡入淡出动画 */
.fade-in {
opacity: 1;
transition: opacity 0.15s ease-out;
}
.fade-out {
opacity: 0;
}
/* 过渡状态 */
.fade-in-out.transitioning {
pointer-events: none;
/* 过渡期间禁用交互 */
.slide-in {
transform: translateY(0);
opacity: 1;
}
/* 自定义淡入淡出动画 */
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.15s ease;
}
.fade-enter-from,
.fade-leave-to {
.slide-out {
transform: translateY(100px);
opacity: 0;
}
</style>

View File

@ -1,7 +1,7 @@
export interface AnimationOption {
durationMs?: number;
name?: 'fade' | 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right';
name?: 'fade' | 'slide'
easing?: 'ease' | 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out';
}
@ -12,6 +12,7 @@ function sleep(time: number) {
}
let lastAnimationId = '';
let lastAnimationOption: AnimationOption | undefined = undefined;
export async function animateIn(id: string, animationOption?: AnimationOption) {
const element = document.getElementById(id);
@ -20,9 +21,10 @@ export async function animateIn(id: string, animationOption?: AnimationOption) {
}
lastAnimationId = id;
lastAnimationOption = animationOption;
const { durationMs = 150, name = 'fade', easing = 'ease-out' } = animationOption || {};
element.style.transition = `opacity ${durationMs / 1000}s ${easing}`;
element.style.transition = `all ${durationMs / 1000}s ${easing}`;
element.classList.remove(name + '-in');
element.classList.add(name + '-out');
@ -30,13 +32,15 @@ export async function animateIn(id: string, animationOption?: AnimationOption) {
}
export async function animateOut(animationOption?: AnimationOption) {
animationOption = animationOption || lastAnimationOption;
const element = document.getElementById(lastAnimationId);
if (!element) {
return;
}
const { durationMs = 150, name = 'fade', easing = 'ease-out' } = animationOption || {};
element.style.transition = `opacity ${durationMs / 1000}s ${easing}`;
element.style.transition = `all ${durationMs / 1000}s ${easing}`;
element.classList.remove(name + '-out');
element.classList.add(name + '-in');

View File

@ -5,24 +5,27 @@ import DefaultTheme from 'vitepress/theme';
import CustomLayout from './Layout.vue';
import HeroImage from './components/home/HeroImage.vue';
import TwoSideLayout from './components/home/TwoSideLayout.vue';
import KTab from './components/KTab/index.vue';
import BiliPlayer from './components/bilibli-player/index.vue';
import KNavItem from './components/nav-item/index.vue';
import { NolebaseGitChangelogPlugin } from '@nolebase/vitepress-plugin-git-changelog/client';
import { NolebaseInlineLinkPreviewPlugin } from '@nolebase/vitepress-plugin-inline-link-preview/client';
import { ElCollapse, ElCollapseItem } from 'element-plus';
import './css/style.css';
import './css/iconfont.css';
import './css/element-plus.css';
import '@nolebase/vitepress-plugin-git-changelog/client/style.css';
import '@nolebase/vitepress-plugin-enhanced-mark/client/style.css';
import '@nolebase/vitepress-plugin-inline-link-preview/client/style.css';
export default {
extends: DefaultTheme,
Layout: () => {
return h(CustomLayout, null, {
'home-hero-image': () => h(HeroImage)
})
return h(CustomLayout)
},
enhanceApp({ app, router, siteData }) {
app.component('TwoSideLayout', TwoSideLayout);
@ -31,5 +34,7 @@ export default {
app.component('KNavItem', KNavItem);
app.component('el-collapse', ElCollapse);
app.component('el-collapse-item', ElCollapseItem);
app.use(NolebaseGitChangelogPlugin);
app.use(NolebaseInlineLinkPreviewPlugin);
}
} satisfies Theme

171
package-lock.json generated
View File

@ -9,7 +9,10 @@
"vitepress": "^1.6.3"
},
"devDependencies": {
"@nolebase/vitepress-plugin-enhanced-mark": "^2.17.1",
"@nolebase/vitepress-plugin-git-changelog": "^2.17.1",
"@nolebase/vitepress-plugin-inline-link-preview": "^2.17.1",
"@nolebase/vitepress-plugin-page-properties": "^2.17.1",
"vitepress-plugin-lightbox": "^1.0.2"
}
},
@ -696,6 +699,16 @@
"integrity": "sha512-MDWhGtE+eHw5JW7lq4qhc5yRLS11ERl1c7Z6Xd0a58DozHES6EnNNwUWbMiG4J9Cgj053Bhk8zvlhFYKVhULwg==",
"license": "MIT"
},
"node_modules/@iconify-json/icon-park-outline": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@iconify-json/icon-park-outline/-/icon-park-outline-1.2.2.tgz",
"integrity": "sha512-7VkMWOZTIMNkC9+oAL4I5kVlVC5Pq3nQpruZ4E3cLyKaeV95gaUrEilUkvGW71fgsFYCBWAmOZ3KpM4ux0j0zA==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"@iconify/types": "*"
}
},
"node_modules/@iconify-json/octicon": {
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/@iconify-json/octicon/-/octicon-1.2.6.tgz",
@ -714,6 +727,16 @@
"@iconify/types": "*"
}
},
"node_modules/@iconify-json/svg-spinners": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@iconify-json/svg-spinners/-/svg-spinners-1.2.2.tgz",
"integrity": "sha512-DIErwfBWWzLfmAG2oQnbUOSqZhDxlXvr8941itMCrxQoMB0Hiv8Ww6Bln/zIgxwjDvSem2dKJtap+yKKwsB/2A==",
"dev": true,
"license": "MIT",
"dependencies": {
"@iconify/types": "*"
}
},
"node_modules/@iconify/types": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/@iconify/types/-/types-2.0.0.tgz",
@ -762,6 +785,16 @@
"node": ">= 8"
}
},
"node_modules/@nolebase/markdown-it-element-transform": {
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/@nolebase/markdown-it-element-transform/-/markdown-it-element-transform-2.17.1.tgz",
"integrity": "sha512-qNYR3JzrdyOcEqBPlv/4IJ+mxk8WZif+WJcMtf1/yrd3qRbPmiecSzropOyLTi0xYd97qO3LkBKFkCXPmikltQ==",
"dev": true,
"license": "MIT",
"peerDependencies": {
"markdown-it": ">=14.1.0"
}
},
"node_modules/@nolebase/ui": {
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/@nolebase/ui/-/ui-2.17.1.tgz",
@ -777,6 +810,19 @@
"vitepress": "^1.5.0 || ^2.0.0-alpha.1"
}
},
"node_modules/@nolebase/vitepress-plugin-enhanced-mark": {
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/@nolebase/vitepress-plugin-enhanced-mark/-/vitepress-plugin-enhanced-mark-2.17.1.tgz",
"integrity": "sha512-l+n9+vPdagItP/GVK+llqOxOrXJGrbUC3uCUMjQ6r7yOBuAmMGpw/AI2VbTFlhPZkGhLo6awew8FOOtw5W0dXg==",
"dev": true,
"license": "MIT",
"dependencies": {
"less": "^4.3.0"
},
"peerDependencies": {
"vitepress": "^1.5.0 || ^2.0.0-alpha.1"
}
},
"node_modules/@nolebase/vitepress-plugin-git-changelog": {
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/@nolebase/vitepress-plugin-git-changelog/-/vitepress-plugin-git-changelog-2.17.1.tgz",
@ -800,6 +846,45 @@
"vitepress": "^1.5.0 || ^2.0.0-alpha.1"
}
},
"node_modules/@nolebase/vitepress-plugin-inline-link-preview": {
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/@nolebase/vitepress-plugin-inline-link-preview/-/vitepress-plugin-inline-link-preview-2.17.1.tgz",
"integrity": "sha512-PbiTtmpEFYUmxunWbB6TvVFlQgn8VgNofFXychy9nfcZj2wF/+gXrvZ2wBbdteBdJPoDgUEPvwZ7zxTEnY4rZg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@iconify-json/icon-park-outline": "^1.2.2",
"@iconify-json/octicon": "^1.2.6",
"@iconify-json/svg-spinners": "^1.2.2",
"@nolebase/markdown-it-element-transform": "^2.17.1",
"@nolebase/ui": "^2.17.1",
"less": "^4.3.0",
"markdown-it": "^14.1.0",
"markdown-it-attrs": "^4.3.1"
},
"peerDependencies": {
"vitepress": "^1.5.0 || ^2.0.0-alpha.1"
}
},
"node_modules/@nolebase/vitepress-plugin-page-properties": {
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/@nolebase/vitepress-plugin-page-properties/-/vitepress-plugin-page-properties-2.17.1.tgz",
"integrity": "sha512-o0tTbJvc390PObGv5tRDq7BENGUkKF1Nm6/soZdV++zoIdb13MyKzKSuoBpnHomVhLzjx0z3uxgGUO4r08bQ8Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"@iconify-json/icon-park-outline": "^1.2.2",
"@iconify-json/octicon": "^1.2.6",
"@nolebase/ui": "^2.17.1",
"date-fns": "^4.1.0",
"gray-matter": "^4.0.3",
"less": "^4.3.0",
"uuid": "^11.1.0"
},
"peerDependencies": {
"vitepress": "^1.5.0 || ^2.0.0-alpha.1"
}
},
"node_modules/@popperjs/core": {
"name": "@sxzz/popperjs-es",
"version": "2.11.7",
@ -2319,6 +2404,16 @@
"devOptional": true,
"license": "MIT"
},
"node_modules/linkify-it": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz",
"integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"uc.micro": "^2.0.0"
}
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
@ -2370,6 +2465,44 @@
"resolved": "https://registry.npmmirror.com/mark.js/-/mark.js-8.11.1.tgz",
"integrity": "sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ=="
},
"node_modules/markdown-it": {
"version": "14.1.0",
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz",
"integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==",
"dev": true,
"license": "MIT",
"dependencies": {
"argparse": "^2.0.1",
"entities": "^4.4.0",
"linkify-it": "^5.0.0",
"mdurl": "^2.0.0",
"punycode.js": "^2.3.1",
"uc.micro": "^2.1.0"
},
"bin": {
"markdown-it": "bin/markdown-it.mjs"
}
},
"node_modules/markdown-it-attrs": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/markdown-it-attrs/-/markdown-it-attrs-4.3.1.tgz",
"integrity": "sha512-/ko6cba+H6gdZ0DOw7BbNMZtfuJTRp9g/IrGIuz8lYc/EfnmWRpaR3CFPnNbVz0LDvF8Gf1hFGPqrQqq7De0rg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=6"
},
"peerDependencies": {
"markdown-it": ">= 9.0.0"
}
},
"node_modules/markdown-it/node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"dev": true,
"license": "Python-2.0"
},
"node_modules/mdast-util-to-hast": {
"version": "13.2.0",
"resolved": "https://registry.npmmirror.com/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz",
@ -2390,6 +2523,13 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/mdurl": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz",
"integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==",
"dev": true,
"license": "MIT"
},
"node_modules/medium-zoom": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/medium-zoom/-/medium-zoom-1.1.0.tgz",
@ -2775,6 +2915,16 @@
"license": "MIT",
"optional": true
},
"node_modules/punycode.js": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz",
"integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@ -3130,6 +3280,13 @@
"devOptional": true,
"license": "0BSD"
},
"node_modules/uc.micro": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz",
"integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==",
"dev": true,
"license": "MIT"
},
"node_modules/uncrypto": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/uncrypto/-/uncrypto-0.1.3.tgz",
@ -3213,6 +3370,20 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/uuid": {
"version": "11.1.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz",
"integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==",
"dev": true,
"funding": [
"https://github.com/sponsors/broofa",
"https://github.com/sponsors/ctavan"
],
"license": "MIT",
"bin": {
"uuid": "dist/esm/bin/uuid"
}
},
"node_modules/vfile": {
"version": "6.0.3",
"resolved": "https://registry.npmmirror.com/vfile/-/vfile-6.0.3.tgz",

View File

@ -10,7 +10,10 @@
"vitepress": "^1.6.3"
},
"devDependencies": {
"@nolebase/vitepress-plugin-enhanced-mark": "^2.17.1",
"@nolebase/vitepress-plugin-git-changelog": "^2.17.1",
"@nolebase/vitepress-plugin-inline-link-preview": "^2.17.1",
"@nolebase/vitepress-plugin-page-properties": "^2.17.1",
"vitepress-plugin-lightbox": "^1.0.2"
}
}

View File

@ -13,3 +13,4 @@ Python 写 mcp 服务器强烈推荐使用 uv 作为包管理器
:::
<mark>awdwadwa</mark>