Skip to content

Commit 68570f1

Browse files
committed
Add custom components, update vuepress version
1 parent b2982b3 commit 68570f1

File tree

7 files changed

+424
-220
lines changed

7 files changed

+424
-220
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<template>
2+
<span
3+
class="badge scope"
4+
:class="scope"
5+
>
6+
<slot>{{ scope }}</slot>
7+
</span>
8+
</template>
9+
10+
<script setup>
11+
defineProps({
12+
scope: {
13+
type: String,
14+
required: true
15+
}
16+
})
17+
</script>
18+
19+
<style scoped>
20+
.badge.scope {
21+
vertical-align: middle;
22+
text-transform: capitalize;
23+
}
24+
.badge.android {
25+
background-color: var(--c-badge-tip);
26+
}
27+
.badge.desktop {
28+
background-color: var(--usc-scope);
29+
}
30+
</style>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<template>
2+
<span class="since">{{ text }} <b>{{ version }}</b></span>
3+
</template>
4+
5+
<script>
6+
export default {
7+
props: {
8+
text: {
9+
type: String,
10+
required: false,
11+
default: ''
12+
},
13+
version: {
14+
type: String,
15+
required: true
16+
}
17+
}
18+
}
19+
</script>
20+
21+
<style scoped>
22+
.since {
23+
display: inline-block;
24+
font-size: 13px;
25+
height: 18px;
26+
line-height: 18px;
27+
border-radius: 3px;
28+
padding: 0 4px;
29+
color: var(--c-bg);
30+
background-color: var(--usc-since);
31+
}
32+
</style>

docs/docs/.vuepress/config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import { defineUserConfig, defaultTheme } from 'vuepress'
2+
import { getDirname, path } from '@vuepress/utils'
3+
import { registerComponentsPlugin } from '@vuepress/plugin-register-components'
24
import { prismjsPlugin } from '@vuepress/plugin-prismjs'
35
import { sidebarConfig } from './configs/sidebar'
46
import { navbarConfig } from './configs/navbar'
57
import Prism from 'prismjs';
68
import definePrismOwnLang from '../../../editors/prismjs/own-language.js'
9+
710
definePrismOwnLang(Prism)
11+
const __dirname = getDirname(import.meta.url)
812

913
export default defineUserConfig({
1014
locales: {
@@ -44,5 +48,8 @@ export default defineUserConfig({
4448
prismjsPlugin({
4549
preloadLanguages: ['own', 'json']
4650
}),
51+
registerComponentsPlugin({
52+
componentsDir: path.resolve(__dirname, './components'),
53+
})
4754
],
4855
})

docs/docs/.vuepress/styles/palette.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
--c-brand-light: #ff9562;
44
--c-badge-danger: #f63f3f;
55
--c-badge-warning: #d0af01;
6+
7+
--usc-since: var(--c-badge-warning);
8+
--usc-scope: var(--c-brand);
69
}
710
html.dark {
811
--c-brand: #e1792d;

docs/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
"author": "aNNiMON",
1212
"license": "MIT",
1313
"devDependencies": {
14+
"@vuepress/client": "2.0.0-rc.0",
15+
"@vuepress/plugin-prismjs": "2.0.0-rc.0",
16+
"@vuepress/plugin-register-components": "2.0.0-rc.0",
17+
"@vuepress/utils": "2.0.0-rc.0",
1418
"prismjs": "^1.29.0",
15-
"@vuepress/client": "2.0.0-beta.68",
16-
"@vuepress/plugin-prismjs": "2.0.0-beta.68",
1719
"vue": "^3.3.8",
18-
"vuepress": "2.0.0-beta.68"
20+
"vuepress": "2.0.0-rc.0"
1921
}
2022
}

0 commit comments

Comments
 (0)