Skip to content

Commit b8b6d52

Browse files
committed
feat: 增加@142vip/vuepress模块的演示示例,降低配置难度
1 parent eb0341b commit b8b6d52

File tree

18 files changed

+453
-0
lines changed

18 files changed

+453
-0
lines changed

apps/vuepress-demo/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# vuepress-demo
2+
3+
## 介绍
4+
5+
## 证书
6+
7+
[MIT](https://opensource.org/license/MIT)
8+
9+
Copyright (c) 2019-present, 142vip 储凡
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# vuepress 目录规范
2+
3+
- `styles` 目录固定
4+
- `public` 目录固定
1.51 KB
Binary file not shown.
9.44 KB
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// 参考:https://theme-hope.vuejs.press/zh/config/style.html
2+
3+
// 浅色主题
4+
//ateliersulphurpool-light
5+
//coldark-cold
6+
//coy
7+
//duotone-light
8+
//ghcolors
9+
//gruvbox-light
10+
//material-light
11+
//one-light
12+
//vs
13+
//$code-light-theme: 'coldark-cold';
14+
//
15+
//// 深色主题
16+
//$code-dark-theme: 'atom-dark';
17+
18+
// 主题色 配合outlook显示
19+
$theme-color: #fb9b5f;
20+
//$theme-colors: #2196f3, #f26d6d, #3eaf7c, #fb9b5f;
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
/* 此处自定义样式,对主题进行覆盖 */
2+
3+
// 全站主题色
4+
:root {
5+
// brand colors
6+
// --c-brand: #3eaf7c;
7+
// --c-brand-light: #4abf8a;
8+
9+
--c-brand: #4ce9ad;
10+
--c-brand-light: #42b983;
11+
12+
// background colors
13+
--c-bg: #ffffff;
14+
--c-bg-light: #f3f4f5;
15+
--c-bg-lighter: #eeeeee;
16+
--c-bg-navbar: var(--c-bg);
17+
--c-bg-sidebar: var(--c-bg);
18+
--c-bg-arrow: #cccccc;
19+
20+
// text colors
21+
--c-text: #2c3e50;
22+
--c-text-accent: var(--c-brand);
23+
--c-text-light: #3a5169;
24+
--c-text-lighter: #4e6e8e;
25+
--c-text-lightest: #6a8bad;
26+
--c-text-quote: #999999;
27+
28+
// border colors
29+
--c-border: #eaecef;
30+
--c-border-dark: #dfe2e5;
31+
32+
// custom container colors
33+
--c-tip: #42b983;
34+
--c-tip-bg: var(--c-bg-light);
35+
--c-tip-title: var(--c-text);
36+
--c-tip-text: var(--c-text);
37+
--c-tip-text-accent: var(--c-text-accent);
38+
--c-warning: #e7c000;
39+
--c-warning-bg: #fffae3;
40+
--c-warning-title: #ad9000;
41+
--c-warning-text: #746000;
42+
--c-warning-text-accent: var(--c-text);
43+
--c-danger: #cc0000;
44+
--c-danger-bg: #ffe0e0;
45+
--c-danger-title: #990000;
46+
--c-danger-text: #660000;
47+
--c-danger-text-accent: var(--c-text);
48+
--c-details-bg: #eeeeee;
49+
50+
// badge component colors
51+
--c-badge-tip: var(--c-tip);
52+
--c-badge-warning: var(--c-warning);
53+
--c-badge-danger: var(--c-danger);
54+
55+
// transition vars
56+
--t-color: 0.3s ease;
57+
--t-transform: 0.3s ease;
58+
59+
// code blocks vars
60+
--code-bg-color: #282c34;
61+
--code-hl-bg-color: rgba(0, 0, 0, 0.66);
62+
--code-ln-color: #9e9e9e;
63+
--code-ln-wrapper-width: 3.5rem;
64+
65+
// font vars
66+
--font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans',
67+
'Droid Sans', 'Helvetica Neue', sans-serif;
68+
--font-family-code: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
69+
70+
// layout vars
71+
--navbar-height: 3.6rem;
72+
--navbar-padding-v: 0.7rem;
73+
--navbar-padding-h: 1.5rem;
74+
--sidebar-width: 20rem;
75+
--sidebar-width-mobile: calc(var(--sidebar-width) * 0.82);
76+
--content-width: 740px;
77+
--homepage-width: 960px;
78+
}
79+
80+
// plugin-docsearch
81+
.DocSearch {
82+
--docsearch-primary-color: var(--c-brand);
83+
--docsearch-text-color: var(--c-text);
84+
--docsearch-highlight-color: var(--c-brand);
85+
--docsearch-muted-color: var(--c-text-quote);
86+
--docsearch-container-background: rgba(9, 10, 17, 0.8);
87+
--docsearch-modal-background: var(--c-bg-light);
88+
--docsearch-searchbox-background: var(--c-bg-lighter);
89+
--docsearch-searchbox-focus-background: var(--c-bg);
90+
--docsearch-searchbox-shadow: inset 0 0 0 2px var(--c-brand);
91+
--docsearch-hit-color: var(--c-text-light);
92+
--docsearch-hit-active-color: var(--c-bg);
93+
--docsearch-hit-background: var(--c-bg);
94+
--docsearch-hit-shadow: 0 1px 3px 0 var(--c-border-dark);
95+
--docsearch-footer-background: var(--c-bg);
96+
}
97+
98+
// plugin-external-link-icon
99+
.external-link-icon {
100+
--external-link-icon-color: var(--c-text-quote);
101+
}
102+
103+
// plugin-medium-zoom
104+
.medium-zoom-overlay {
105+
--medium-zoom-bg-color: var(--c-bg);
106+
}
107+
108+
// plugin-pwa-popup
109+
.pwa-popup {
110+
--pwa-popup-text-color: var(--c-text);
111+
--pwa-popup-bg-color: var(--c-bg);
112+
--pwa-popup-border-color: var(--c-brand);
113+
--pwa-popup-shadow: 0 4px 16px var(--c-brand);
114+
--pwa-popup-btn-text-color: var(--c-bg);
115+
--pwa-popup-btn-bg-color: var(--c-brand);
116+
--pwa-popup-btn-hover-bg-color: var(--c-brand-light);
117+
}
118+
119+
// plugin-search
120+
.search-box {
121+
--search-bg-color: var(--c-bg);
122+
--search-accent-color: var(--c-brand);
123+
--search-text-color: var(--c-text);
124+
--search-border-color: var(--c-border);
125+
126+
--search-item-text-color: var(--c-text-lighter);
127+
--search-item-focus-bg-color: var(--c-bg-light);
128+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//$sidebar-width: 20rem;
2+
//$sidebar-mobile-width: 16rem;
3+
//$content-width: 75rem;
4+
$home-page-width: 80rem;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 自定义布局
2+
3+
## 参考
4+
5+
- <https://vuejs.press/zh/reference/frontmatter.html#layout>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { navbar } from 'vuepress-theme-hope'
2+
3+
/**
4+
* 导航栏配置
5+
*/
6+
export default navbar([
7+
{
8+
text: '🌐 首页',
9+
link: '/',
10+
},
11+
{
12+
text: '💻 示例文档',
13+
children: [
14+
{
15+
text: '👩🏻‍💻 示例文档-1',
16+
link: '/example/test-1.md',
17+
},
18+
{
19+
text: '👨🏻‍💻 示例文档-2',
20+
link: '/example/test-2.md',
21+
},
22+
{
23+
text: '👨🏻 示例文档-3',
24+
link: '/example/test-3.md',
25+
},
26+
],
27+
},
28+
{
29+
text: '👉 了解更多',
30+
children: [
31+
{
32+
text: '📄 更新日志',
33+
link: '/changelog',
34+
},
35+
{
36+
text: '开源博客',
37+
children: [
38+
{
39+
text: '🤡 408CSFamily',
40+
link: 'https://142vip-cn.feishu.cn/share/base/view/shrcnuuRDWBoHLmYaknXWFuhR4d',
41+
},
42+
{
43+
text: '📘 JavaScriptCollection',
44+
link: 'https://142vip.github.io/JavaScriptCollection/',
45+
},
46+
],
47+
},
48+
49+
],
50+
},
51+
])
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { sidebar } from 'vuepress-theme-hope'
2+
3+
/**
4+
* 侧边栏配置
5+
*/
6+
export default sidebar({
7+
'/example': [
8+
{
9+
text: '示例文档',
10+
// prefix: 'example',
11+
collapsible: false,
12+
children: [
13+
{
14+
text: '示例文档-1',
15+
link: 'test-1.md',
16+
},
17+
{
18+
text: '示例文档-2',
19+
link: 'test-2.md',
20+
},
21+
{
22+
text: '示例文档-3',
23+
link: 'test-3.md',
24+
},
25+
],
26+
},
27+
],
28+
})

0 commit comments

Comments
 (0)