@wot-ui/vitepress-theme 2.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +153 -0
- package/dist/config.js +118 -0
- package/dist/index.js +68 -0
- package/dist/locales/md-component-links.js +15 -0
- package/dist/plugins/md-component-links.js +34 -0
- package/dist/plugins/md-scss-vars.js +73 -0
- package/dist/plugins/md-version-badge.js +51 -0
- package/dist/plugins/virtual-version-data.js +83 -0
- package/dist/src/config.d.ts +3 -0
- package/dist/src/index.d.ts +21 -0
- package/dist/src/locales/md-component-links.d.ts +13 -0
- package/dist/src/plugins/md-component-links.d.ts +3 -0
- package/dist/src/plugins/md-scss-vars.d.ts +3 -0
- package/dist/src/plugins/md-version-badge.d.ts +6 -0
- package/dist/src/plugins/virtual-version-data.d.ts +3 -0
- package/dist/src/theme/composables/adSponsor.d.ts +30 -0
- package/dist/src/theme/composables/adsData.d.ts +16 -0
- package/dist/src/theme/composables/banner.d.ts +16 -0
- package/dist/src/theme/composables/cases.d.ts +16 -0
- package/dist/src/theme/composables/friendly.d.ts +19 -0
- package/dist/src/theme/composables/sponsor.d.ts +3 -0
- package/dist/src/theme/composables/team.d.ts +28 -0
- package/dist/src/theme/options.d.ts +3 -0
- package/dist/src/types.d.ts +86 -0
- package/dist/theme/Layout.vue +45 -0
- package/dist/theme/components/AsideSponsors.vue +105 -0
- package/dist/theme/components/Banner.vue +377 -0
- package/dist/theme/components/CustomFooter.vue +123 -0
- package/dist/theme/components/ExternalLink.vue +36 -0
- package/dist/theme/components/HomeCases.vue +122 -0
- package/dist/theme/components/HomeFriendly.vue +96 -0
- package/dist/theme/components/HomeTeam.vue +250 -0
- package/dist/theme/components/QrCode.vue +45 -0
- package/dist/theme/components/SidebarAds.vue +86 -0
- package/dist/theme/components/SpecialSponsor.vue +115 -0
- package/dist/theme/components/SvgImage.vue +22 -0
- package/dist/theme/components/VPContent.vue +92 -0
- package/dist/theme/components/VPDoc.vue +222 -0
- package/dist/theme/components/VPFeature.vue +150 -0
- package/dist/theme/components/VPIframe.vue +445 -0
- package/dist/theme/components/VPLocalNav.vue +151 -0
- package/dist/theme/components/VPNavBar.vue +253 -0
- package/dist/theme/components/VPSidebar.vue +120 -0
- package/dist/theme/components/VPSidebarItem.vue +271 -0
- package/dist/theme/components/WwAds.vue +74 -0
- package/dist/theme/composables/adSponsor.js +29 -0
- package/dist/theme/composables/adsData.js +35 -0
- package/dist/theme/composables/banner.js +35 -0
- package/dist/theme/composables/cases.js +43 -0
- package/dist/theme/composables/friendly.js +35 -0
- package/dist/theme/composables/sponsor.js +35 -0
- package/dist/theme/composables/team.js +48 -0
- package/dist/theme/options.js +4 -0
- package/dist/theme/styles/custom.css +206 -0
- package/dist/theme/styles/vars.css +136 -0
- package/dist/types.js +0 -0
- package/package.json +41 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type GridSize = 'xmini' | 'mini' | 'small' | 'medium' | 'big';
|
|
2
|
+
export interface Sponsor {
|
|
3
|
+
name: string;
|
|
4
|
+
img: string;
|
|
5
|
+
url: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Sponsors {
|
|
8
|
+
tier?: string;
|
|
9
|
+
size?: GridSize;
|
|
10
|
+
items: Sponsor[];
|
|
11
|
+
}
|
|
12
|
+
export declare function useAdSponsor(): {
|
|
13
|
+
data: import("vue").Ref<{
|
|
14
|
+
tier?: string;
|
|
15
|
+
size?: GridSize;
|
|
16
|
+
items: {
|
|
17
|
+
name: string;
|
|
18
|
+
img: string;
|
|
19
|
+
url: string;
|
|
20
|
+
}[];
|
|
21
|
+
}[], Sponsors[] | {
|
|
22
|
+
tier?: string;
|
|
23
|
+
size?: GridSize;
|
|
24
|
+
items: {
|
|
25
|
+
name: string;
|
|
26
|
+
img: string;
|
|
27
|
+
url: string;
|
|
28
|
+
}[];
|
|
29
|
+
}[]>;
|
|
30
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type AdData = {
|
|
2
|
+
image: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
link?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function useAds(): {
|
|
7
|
+
data: import("vue").Ref<{
|
|
8
|
+
image: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
link?: string;
|
|
11
|
+
}[], AdData[] | {
|
|
12
|
+
image: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
link?: string;
|
|
15
|
+
}[]>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type BannerData = {
|
|
2
|
+
action: string;
|
|
3
|
+
title: string;
|
|
4
|
+
link: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function useBanner(): {
|
|
7
|
+
data: import("vue").Ref<{
|
|
8
|
+
action: string;
|
|
9
|
+
title: string;
|
|
10
|
+
link: string;
|
|
11
|
+
}[], BannerData[] | {
|
|
12
|
+
action: string;
|
|
13
|
+
title: string;
|
|
14
|
+
link: string;
|
|
15
|
+
}[]>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type CaseData = {
|
|
2
|
+
name: string;
|
|
3
|
+
image: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function useCaseData(): {
|
|
7
|
+
data: import("vue").Ref<{
|
|
8
|
+
name: string;
|
|
9
|
+
image: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
}[], CaseData[] | {
|
|
12
|
+
name: string;
|
|
13
|
+
image: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
}[]>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type FriendlyLink = {
|
|
2
|
+
icon: string;
|
|
3
|
+
title: string;
|
|
4
|
+
details: string;
|
|
5
|
+
link: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function useFriendly(): {
|
|
8
|
+
data: import("vue").Ref<{
|
|
9
|
+
icon: string;
|
|
10
|
+
title: string;
|
|
11
|
+
details: string;
|
|
12
|
+
link: string;
|
|
13
|
+
}[], FriendlyLink[] | {
|
|
14
|
+
icon: string;
|
|
15
|
+
title: string;
|
|
16
|
+
details: string;
|
|
17
|
+
link: string;
|
|
18
|
+
}[]>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type TeamMember = {
|
|
2
|
+
avatar: string;
|
|
3
|
+
name: string;
|
|
4
|
+
title: string;
|
|
5
|
+
tags?: string[];
|
|
6
|
+
desc?: string;
|
|
7
|
+
github?: string;
|
|
8
|
+
twitter?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function useTeam(): {
|
|
11
|
+
data: import("vue").Ref<{
|
|
12
|
+
avatar: string;
|
|
13
|
+
name: string;
|
|
14
|
+
title: string;
|
|
15
|
+
tags?: string[];
|
|
16
|
+
desc?: string;
|
|
17
|
+
github?: string;
|
|
18
|
+
twitter?: string;
|
|
19
|
+
}[], TeamMember[] | {
|
|
20
|
+
avatar: string;
|
|
21
|
+
name: string;
|
|
22
|
+
title: string;
|
|
23
|
+
tags?: string[];
|
|
24
|
+
desc?: string;
|
|
25
|
+
github?: string;
|
|
26
|
+
twitter?: string;
|
|
27
|
+
}[]>;
|
|
28
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { DefaultTheme, HeadConfig, UserConfig } from 'vitepress';
|
|
2
|
+
import type { PluginOption } from 'vite';
|
|
3
|
+
export interface WotThemeAnalyticsOptions {
|
|
4
|
+
trackBaiduRoute?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface WotThemeBannerOptions {
|
|
7
|
+
urls: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface WotThemeSponsorOptions {
|
|
10
|
+
urls: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface WotThemeAdsOptions {
|
|
13
|
+
wwadsId?: string;
|
|
14
|
+
urls?: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface WotThemeTeamOptions {
|
|
17
|
+
urls: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface WotThemeFriendlyOptions {
|
|
20
|
+
urls: string[];
|
|
21
|
+
}
|
|
22
|
+
export interface WotThemeCasesOptions {
|
|
23
|
+
urls: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface WotThemeDemoIframeOptions {
|
|
26
|
+
assetBase?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface WotVitePressThemeOptions {
|
|
29
|
+
analytics?: false | WotThemeAnalyticsOptions;
|
|
30
|
+
banner?: false | WotThemeBannerOptions;
|
|
31
|
+
sponsors?: false | WotThemeSponsorOptions;
|
|
32
|
+
ads?: false | WotThemeAdsOptions;
|
|
33
|
+
team?: false | WotThemeTeamOptions;
|
|
34
|
+
friendly?: false | WotThemeFriendlyOptions;
|
|
35
|
+
cases?: false | WotThemeCasesOptions;
|
|
36
|
+
demoIframe?: false | WotThemeDemoIframeOptions;
|
|
37
|
+
}
|
|
38
|
+
export interface WotLlmsFeatureOptions {
|
|
39
|
+
domain: string;
|
|
40
|
+
ignoreFiles?: string[];
|
|
41
|
+
}
|
|
42
|
+
export interface WotMdComponentLinksOptions {
|
|
43
|
+
repoUrl: string;
|
|
44
|
+
demoSourceRoot: string;
|
|
45
|
+
componentSourceRoot: string;
|
|
46
|
+
}
|
|
47
|
+
export interface WotMdScssVarsOptions {
|
|
48
|
+
componentScssRoot: string;
|
|
49
|
+
componentMap?: Record<string, string[]>;
|
|
50
|
+
}
|
|
51
|
+
export interface WotVirtualVersionDataOptions {
|
|
52
|
+
docsRoot?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface WotMarkdownSourceOptions {
|
|
55
|
+
componentLinks?: false | WotMdComponentLinksOptions;
|
|
56
|
+
scssVars?: false | WotMdScssVarsOptions;
|
|
57
|
+
versionBadge?: boolean;
|
|
58
|
+
virtualVersionData?: false | WotVirtualVersionDataOptions;
|
|
59
|
+
}
|
|
60
|
+
export interface WotVitePressFeatureOptions {
|
|
61
|
+
llms?: false | WotLlmsFeatureOptions;
|
|
62
|
+
compression?: false | Record<string, unknown>;
|
|
63
|
+
}
|
|
64
|
+
export interface WotVitePressConfigOptions {
|
|
65
|
+
title: string;
|
|
66
|
+
description: string;
|
|
67
|
+
head?: HeadConfig[];
|
|
68
|
+
locales?: UserConfig['locales'];
|
|
69
|
+
themeConfig?: DefaultTheme.Config;
|
|
70
|
+
vite?: UserConfig['vite'];
|
|
71
|
+
markdown: WotMarkdownSourceOptions;
|
|
72
|
+
features?: WotVitePressFeatureOptions;
|
|
73
|
+
}
|
|
74
|
+
export interface WotResolvedThemeOptions {
|
|
75
|
+
analytics: {
|
|
76
|
+
trackBaiduRoute: boolean;
|
|
77
|
+
};
|
|
78
|
+
banner: false | WotThemeBannerOptions;
|
|
79
|
+
sponsors: false | WotThemeSponsorOptions;
|
|
80
|
+
ads: false | WotThemeAdsOptions;
|
|
81
|
+
team: false | WotThemeTeamOptions;
|
|
82
|
+
friendly: false | WotThemeFriendlyOptions;
|
|
83
|
+
cases: false | WotThemeCasesOptions;
|
|
84
|
+
demoIframe: false | WotThemeDemoIframeOptions;
|
|
85
|
+
}
|
|
86
|
+
export type WotVitePlugin = Exclude<PluginOption, null | false | undefined>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import DefaultTheme from 'vitepress/theme'
|
|
3
|
+
import Banner from './components/Banner.vue'
|
|
4
|
+
import SpecialSponsor from './components/SpecialSponsor.vue'
|
|
5
|
+
import HomeFriendly from './components/HomeFriendly.vue'
|
|
6
|
+
import HomeTeam from './components/HomeTeam.vue'
|
|
7
|
+
import CustomFooter from './components/CustomFooter.vue'
|
|
8
|
+
import WwAds from './components/WwAds.vue'
|
|
9
|
+
|
|
10
|
+
const { Layout } = DefaultTheme
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<Layout>
|
|
15
|
+
<!-- 全局顶部横幅(Banner 通知条) -->
|
|
16
|
+
<template #layout-top>
|
|
17
|
+
<Banner />
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<!-- 首页 Hero 区域下方,展示特别赞助商 -->
|
|
21
|
+
<template #home-hero-after>
|
|
22
|
+
<SpecialSponsor />
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<!-- 首页 Features 区域下方,展示团队成员、用户案例与友好链接 -->
|
|
26
|
+
<template #home-features-after>
|
|
27
|
+
<HomeTeam />
|
|
28
|
+
<!-- <HomeCases /> -->
|
|
29
|
+
<HomeFriendly />
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<!-- 导航栏 Logo 右侧,品牌标题后缀 -->
|
|
33
|
+
<template #nav-bar-title-after></template>
|
|
34
|
+
|
|
35
|
+
<!-- 文档页侧边栏大纲下方,展示广告位 -->
|
|
36
|
+
<template #aside-outline-after>
|
|
37
|
+
<WwAds />
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<!-- 全局底部页脚 -->
|
|
41
|
+
<template #layout-bottom>
|
|
42
|
+
<CustomFooter />
|
|
43
|
+
</template>
|
|
44
|
+
</Layout>
|
|
45
|
+
</template>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { useAdSponsor } from '../composables/adSponsor'
|
|
4
|
+
|
|
5
|
+
const { data } = useAdSponsor()
|
|
6
|
+
|
|
7
|
+
// 分离超级赞助和金牌赞助
|
|
8
|
+
const superSponsors = computed(() => {
|
|
9
|
+
return data.value?.find((sponsor) => sponsor.tier === 'Platinum')
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
const goldSponsors = computed(() => {
|
|
13
|
+
return data.value?.find((sponsor) => sponsor.tier === 'Gold')
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
// 判断金牌赞助数量是否为奇数
|
|
17
|
+
const isGoldSponsorsOdd = computed(() => {
|
|
18
|
+
return (goldSponsors.value?.items?.length || 0) % 2 === 1
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<div class="VPDocAsideSponsors">
|
|
24
|
+
<a class="sponsors-aside-text" href="/reward/sponsor">赞助位</a>
|
|
25
|
+
<div class="VPSponsors vp-sponsor aside">
|
|
26
|
+
<!-- 超级赞助:一行一个 -->
|
|
27
|
+
<section class="vp-sponsor-section" v-if="superSponsors?.items.length">
|
|
28
|
+
<div class="VPSponsorsGrid vp-sponsor-grid mini" data-vp-grid="1">
|
|
29
|
+
<div class="vp-sponsor-grid-item" v-for="sponsor in superSponsors.items" :key="sponsor.name">
|
|
30
|
+
<a class="vp-sponsor-grid-link" :href="sponsor.url" target="_blank" rel="sponsored noopener">
|
|
31
|
+
<article class="vp-sponsor-grid-box">
|
|
32
|
+
<h4 class="visually-hidden">{{ sponsor.url }}</h4>
|
|
33
|
+
<img v-if="sponsor.img" class="vp-sponsor-grid-image" :src="sponsor.img" :alt="sponsor.name" />
|
|
34
|
+
<span v-else class="vp-sponsor-grid-text">{{ sponsor.name }}</span>
|
|
35
|
+
</article>
|
|
36
|
+
</a>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</section>
|
|
40
|
+
|
|
41
|
+
<!-- 金牌赞助:一行两个 -->
|
|
42
|
+
<section class="vp-sponsor-section" v-if="goldSponsors?.items.length">
|
|
43
|
+
<div class="VPSponsorsGrid vp-sponsor-grid xmini" data-vp-grid="2">
|
|
44
|
+
<div class="vp-sponsor-grid-item" v-for="sponsor in goldSponsors.items" :key="sponsor.name">
|
|
45
|
+
<a class="vp-sponsor-grid-link" :href="sponsor.url" target="_blank" rel="sponsored noopener">
|
|
46
|
+
<article class="vp-sponsor-grid-box">
|
|
47
|
+
<h4 class="visually-hidden">{{ sponsor.name }}</h4>
|
|
48
|
+
<img v-if="sponsor.img" class="vp-sponsor-grid-image" :src="sponsor.img" :alt="sponsor.name" />
|
|
49
|
+
<span v-else class="vp-sponsor-grid-text">{{ sponsor.name }}</span>
|
|
50
|
+
</article>
|
|
51
|
+
</a>
|
|
52
|
+
</div>
|
|
53
|
+
<!-- 当金牌赞助为奇数时,默认赞助位填补到金牌赞助位置 -->
|
|
54
|
+
<div class="vp-sponsor-grid-item" v-if="isGoldSponsorsOdd">
|
|
55
|
+
<a class="vp-sponsor-grid-link" href="/reward/sponsor" rel="sponsored noopener">
|
|
56
|
+
<article class="vp-sponsor-grid-box">
|
|
57
|
+
<span class="vp-sponsor-grid-text">成为赞助商</span>
|
|
58
|
+
</article>
|
|
59
|
+
</a>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</section>
|
|
63
|
+
|
|
64
|
+
<!-- 当金牌赞助为偶数或没有金牌赞助时,默认赞助位占据一整行 -->
|
|
65
|
+
<section class="vp-sponsor-section" v-if="!isGoldSponsorsOdd || !goldSponsors?.items.length">
|
|
66
|
+
<div class="VPSponsorsGrid vp-sponsor-grid xmini" data-vp-grid="1">
|
|
67
|
+
<div class="vp-sponsor-grid-item">
|
|
68
|
+
<a class="vp-sponsor-grid-link" href="/reward/sponsor" rel="sponsored noopener">
|
|
69
|
+
<article class="vp-sponsor-grid-box">
|
|
70
|
+
<span class="vp-sponsor-grid-text">成为赞助商</span>
|
|
71
|
+
</article>
|
|
72
|
+
</a>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</section>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
79
|
+
|
|
80
|
+
<style>
|
|
81
|
+
.vp-sponsor-grid-text {
|
|
82
|
+
color: var(--vp-c-text-2);
|
|
83
|
+
font-size: 12px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.dark .vp-sponsor-grid-text {
|
|
87
|
+
color: var(--vp-c-gray-1);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.vp-sponsor-grid-image {
|
|
91
|
+
max-width: 120px;
|
|
92
|
+
max-height: 72px !important;
|
|
93
|
+
filter: none !important;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
a.sponsors-aside-text {
|
|
97
|
+
color: var(--vp-c-text-3);
|
|
98
|
+
display: block;
|
|
99
|
+
margin: 2em 0 1em;
|
|
100
|
+
font-weight: 700;
|
|
101
|
+
font-size: 11px;
|
|
102
|
+
text-transform: uppercase;
|
|
103
|
+
letter-spacing: 0.4px;
|
|
104
|
+
}
|
|
105
|
+
</style>
|