Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a2767fb

Browse files
committedMay 30, 2024
docs: update theme
1 parent af5303f commit a2767fb

File tree

16 files changed

+214
-359
lines changed

16 files changed

+214
-359
lines changed
 

‎packages/docs/.vuepress/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { defineClientConfig } from '@vuepress/client'
2+
23
import { CIcon } from '@coreui/icons-vue'
34
import CChartPlugin from '@coreui/vue-chartjs'
45
import CoreuiVue from '@coreui/vue/src/'

‎packages/docs/.vuepress/config.ts

Lines changed: 36 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
11
import { defineUserConfig } from 'vuepress'
22
import { viteBundler } from '@vuepress/bundler-vite'
3-
import anchor from 'markdown-it-anchor'
4-
import include_plugin from 'markdown-it-include'
5-
import { defaultTheme } from './src/node/defaultTheme'
6-
7-
import { containerPlugin } from '@vuepress/plugin-container'
3+
import { activeHeaderLinksPlugin } from '@vuepress/plugin-active-header-links'
4+
import { backToTopPlugin } from '@vuepress/plugin-back-to-top'
5+
import { markdownContainerPlugin } from '@vuepress/plugin-markdown-container'
6+
import { prismjsPlugin } from '@vuepress/plugin-prismjs'
87
import { registerComponentsPlugin } from '@vuepress/plugin-register-components'
98
import { tocPlugin } from '@vuepress/plugin-toc'
109
import { getDirname, path } from '@vuepress/utils'
10+
import anchor from 'markdown-it-anchor'
11+
import include_plugin from 'markdown-it-include'
12+
import { defaultTheme } from './src/node'
1113

14+
import { fileURLToPath, URL } from 'url'
1215
const __dirname = getDirname(import.meta.url)
1316

1417
export default defineUserConfig({
1518
base: `/vue/docs/`,
1619
lang: 'en-US',
1720
title: 'Vue UI Components · CoreUI',
1821
description: 'UI Components Library for Vue.js (Vue 3)',
19-
head: [
20-
['link', { rel: 'icon', href: `/vue/docs/favicons/favicon-96x96.png` }],
21-
],
22-
bundler: viteBundler({
23-
viteOptions: {},
24-
vuePluginOptions: {},
25-
}),
22+
head: [['link', { rel: 'icon', href: `/vue/docs/favicons/favicon-96x96.png` }]],
23+
bundler: viteBundler(),
2624
markdown: {
2725
anchor: {
2826
permalink: anchor.permalink.ariaHidden({
2927
class: 'anchor-link',
30-
placement: 'after'
31-
})
32-
},
33-
code: {
34-
lineNumbers: false,
28+
placement: 'after',
29+
}),
3530
},
3631
},
3732
extendsMarkdown: (md) => {
@@ -41,53 +36,42 @@ export default defineUserConfig({
4136
})
4237
},
4338
plugins: [
44-
containerPlugin({
39+
activeHeaderLinksPlugin({
40+
headerLinkSelector: 'a.sidebar-item',
41+
headerAnchorSelector: '.header-anchor',
42+
// should greater than page transition duration
43+
delay: 300,
44+
}),
45+
// backToTopPlugin(),
46+
markdownContainerPlugin({
4547
type: 'demo',
46-
render: function (tokens, idx) {
47-
if (tokens[idx].nesting === 1) {
48-
return '<div class="docs-example rounded-top p-4">\n'
49-
} else {
50-
return '</div>\n'
51-
}
52-
},
48+
before: (): string => `<div class="docs-example rounded-top p-4">\n`,
49+
after: (): string => '</div>\n',
5350
}),
54-
containerPlugin({
55-
type: 'demo-rounded',
56-
render: function (tokens, idx) {
57-
if (tokens[idx].nesting === 1) {
58-
return '<div class="docs-example rounded p-4">\n'
59-
} else {
60-
return '</div>\n'
61-
}
62-
},
51+
markdownContainerPlugin({
52+
type: 'demo-bg-secondary',
53+
before: (): string =>
54+
`<div class="docs-example rounded-top p-0 bg-body-secondary overflow-hidden">\n`,
55+
after: (): string => '</div>\n',
6356
}),
64-
containerPlugin({
57+
markdownContainerPlugin({
6558
type: 'demo-dark',
66-
render: function (tokens, idx) {
67-
if (tokens[idx].nesting === 1) {
68-
return '<div class="docs-example rounded-top p-4 bg-dark">\n'
69-
} else {
70-
return '</div>\n'
71-
}
72-
},
59+
before: (): string => `<div class="docs-example rounded-top p-4 bg-dark">\n`,
60+
after: (): string => '</div>\n',
7361
}),
74-
containerPlugin({
75-
type: 'demo-bg-secondary',
76-
render: function (tokens, idx) {
77-
if (tokens[idx].nesting === 1) {
78-
return '<div class="docs-example rounded-top p-0 bg-body-secondary overflow-hidden">\n'
79-
} else {
80-
return '</div>\n'
81-
}
82-
},
62+
markdownContainerPlugin({
63+
type: 'demo-rounded',
64+
before: (): string => `<div class="docs-example rounded p-4">\n`,
65+
after: (): string => '</div>\n',
8366
}),
84-
tocPlugin({}),
67+
prismjsPlugin(),
8568
registerComponentsPlugin({
8669
components: {
8770
Callout: path.resolve(__dirname, './src/client/components/Callout.vue'),
8871
ScssDocs: path.resolve(__dirname, './src/client/components/ScssDocs.vue'),
8972
},
9073
}),
74+
tocPlugin({}),
9175
],
9276
theme: defaultTheme({
9377
sidebar: [

‎packages/docs/.vuepress/src/client/components/Banner.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
<script setup lang="ts">
2+
import { usePageFrontmatter } from '@vuepress/client'
3+
import type { DefaultThemePageFrontmatter } from '../../shared'
4+
5+
const frontmatter = usePageFrontmatter<DefaultThemePageFrontmatter>()
6+
const pro_component = frontmatter.value.pro_component
7+
</script>
8+
19
<template>
210
<div
311
v-if="pro_component"
@@ -38,11 +46,3 @@
3846
</ul>
3947
</div>
4048
</template>
41-
42-
<script setup lang="ts">
43-
import { usePageFrontmatter } from '@vuepress/client'
44-
import type { DefaultThemePageFrontmatter } from '../../shared'
45-
46-
const frontmatter = usePageFrontmatter<DefaultThemePageFrontmatter>()
47-
const pro_component = frontmatter.value.pro_component
48-
</script>
Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,20 @@
1+
<script setup lang="ts">
2+
const props = defineProps({
3+
color: String,
4+
title: String,
5+
})
6+
7+
const className = [
8+
'docs-callout',
9+
{
10+
[`docs-callout-${props.color}`]: props.color,
11+
},
12+
]
13+
</script>
14+
115
<template>
2-
<div :class="class">
3-
<h5 v-if="title">{{ title }}</h5>
16+
<div :class="className">
17+
<h5 v-if="props.title">{{ props.title }}</h5>
418
<slot></slot>
519
</div>
620
</template>
7-
8-
<script lang="ts">
9-
import { defineComponent } from 'vue'
10-
export default defineComponent({
11-
name: 'Callout',
12-
props: {
13-
color: String,
14-
title: String,
15-
},
16-
setup(props) {
17-
return {
18-
class: [
19-
'docs-callout',
20-
{
21-
[`docs-callout-${props.color}`]: props.color,
22-
}
23-
],
24-
color: props.color,
25-
title: props.title,
26-
}
27-
},
28-
})
29-
</script>

‎packages/docs/.vuepress/src/client/components/Footer.vue

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,4 @@
3535
</p>
3636
</CContainer>
3737
</CFooter>
38-
</template>
39-
40-
<script lang="ts">
41-
import { defineComponent } from 'vue'
42-
import pkg from './../../../../package.json'
43-
export default defineComponent({
44-
name: 'Footer',
45-
setup () {
46-
const version = pkg.version
47-
return {
48-
version
49-
}
50-
}
51-
})
52-
</script>
53-
../../../../package.json
38+
</template>

‎packages/docs/.vuepress/src/client/components/Header.vue

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<script setup lang="ts">
2+
import { useColorModes } from '@coreui/vue/src'
3+
4+
const props = defineProps({
5+
theme: String,
6+
})
7+
8+
const { colorMode, setColorMode } = useColorModes('coreui-vue-docs-theme')
9+
</script>
110
<template>
211
<CHeader class="mb-5 elevation-0 border-bottom" position="sticky">
312
<CHeaderToggler class="ms-md-3" @click="$emit('toggle-sidebar')">
@@ -86,23 +95,3 @@
8695
</CButton>
8796
</CHeader>
8897
</template>
89-
<script lang="ts">
90-
import { defineComponent } from 'vue'
91-
import { useColorModes } from '@coreui/vue/src'
92-
93-
export default defineComponent({
94-
name: 'Header',
95-
props: {
96-
theme: String,
97-
},
98-
emits: ['toggle-sidebar'],
99-
setup() {
100-
const { colorMode, setColorMode } = useColorModes('coreui-vue-docs-theme')
101-
102-
return {
103-
colorMode,
104-
setColorMode,
105-
}
106-
},
107-
})
108-
</script>
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
1-
<template>
2-
<template v-if="frameworks">
3-
<h2>Other frameworks</h2>
4-
<p>
5-
CoreUI components are available as native Angular, Bootstrap (Vanilla JS), and React
6-
components. To learn more please visit the following pages.
7-
</p>
8-
<ul>
9-
<template v-for="framework in frameworks">
10-
<template v-for="(el, index) in Object.keys(otherFrameworks[framework])">
11-
<li v-if="el !== 'vue'" :key="index">
12-
<a :href="otherFrameworks[framework][el]"
13-
>{{ el[0].toUpperCase() + el.slice(1) }} {{ humanize(framework) }}</a
14-
>
15-
</li>
16-
</template>
17-
</template>
18-
</ul>
19-
</template>
20-
</template>
211
<script setup lang="ts">
222
import { usePageFrontmatter } from '@vuepress/client'
233
import jsonData from '../components/other_frameworks.json'
@@ -42,4 +22,24 @@ const humanize = (text: string) => {
4222
return string[0].toUpperCase() + string.slice(1)
4323
}
4424
</script>
45-
./other_frameworks.json
25+
26+
<template>
27+
<template v-if="frameworks">
28+
<h2>Other frameworks</h2>
29+
<p>
30+
CoreUI components are available as native Angular, Bootstrap (Vanilla JS), and React
31+
components. To learn more please visit the following pages.
32+
</p>
33+
<ul>
34+
<template v-for="framework in frameworks">
35+
<template v-for="(el, index) in Object.keys(otherFrameworks[framework])">
36+
<li v-if="el !== 'vue'" :key="index">
37+
<a :href="otherFrameworks[framework][el]"
38+
>{{ el[0].toUpperCase() + el.slice(1) }} {{ humanize(framework) }}</a
39+
>
40+
</li>
41+
</template>
42+
</template>
43+
</ul>
44+
</template>
45+
</template>
Lines changed: 38 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,44 @@
1-
<template>
2-
<div class="highlight">
3-
<pre class="prism-code language-scss" v-html="code" />
4-
</div>
5-
</template>
6-
7-
<script lang="ts">
8-
import { defineComponent } from 'vue'
1+
<script setup lang="ts">
92
import Prism from 'prismjs'
103
import 'prismjs/components/prism-scss'
11-
export default defineComponent({
12-
name: 'ScssDocs',
13-
props: {
14-
capture: String,
15-
file: String,
16-
},
17-
setup(props) {
18-
if (typeof window !== 'undefined') {
19-
window.Prism = window.Prism || {}
20-
window.Prism.manual = true
21-
}
224
23-
const files = import.meta.glob(`../../../../../../node_modules/@coreui/coreui/scss/**/*.scss`, {
24-
query: '?raw',
25-
import: 'default',
26-
eager: true,
27-
})
28-
const file = files[`../../../../../../node_modules/@coreui/coreui/scss/${props.file}`]
5+
const props = defineProps({
6+
capture: String,
7+
file: String,
8+
})
9+
10+
if (typeof window !== 'undefined') {
11+
window.Prism = window.Prism || {}
12+
window.Prism.manual = true
13+
}
2914
30-
const captureStart = `// scss-docs-start ${props.capture}`
31-
const captureEnd = `// scss-docs-end ${props.capture}`
32-
const re = new RegExp(`${captureStart}((?:.|\n)*)${captureEnd}`)
33-
const captured = re.exec(file)
34-
const section = captured && captured[1].trim()
35-
const code = section
36-
? Prism.highlight(
37-
section
38-
.replaceAll('--#{$prefix}', '--cui-')
39-
.replaceAll('\n -', '\n-')
40-
.replaceAll('\n @', '\n@'),
41-
Prism.languages.scss,
42-
'scss',
43-
)
44-
: null
45-
return {
46-
code,
47-
}
48-
},
15+
const files = import.meta.glob(`../../../../../../node_modules/@coreui/coreui/scss/**/*.scss`, {
16+
query: '?raw',
17+
import: 'default',
18+
eager: true,
4919
})
20+
21+
const file = files[`../../../../../../node_modules/@coreui/coreui/scss/${props.file}`]
22+
23+
const captureStart = `// scss-docs-start ${props.capture}`
24+
const captureEnd = `// scss-docs-end ${props.capture}`
25+
const re = new RegExp(`${captureStart}((?:.|\n)*)${captureEnd}`)
26+
const captured = re.exec(file)
27+
const section = captured && captured[1].trim()
28+
const code = section
29+
? Prism.highlight(
30+
section
31+
.replaceAll('--#{$prefix}', '--cui-')
32+
.replaceAll('\n -', '\n-')
33+
.replaceAll('\n @', '\n@'),
34+
Prism.languages.scss,
35+
'scss',
36+
)
37+
: null
5038
</script>
39+
40+
<template>
41+
<div class="highlight">
42+
<pre class="prism-code language-scss" v-html="code" />
43+
</div>
44+
</template>

‎packages/docs/.vuepress/src/client/components/Sidebar.vue

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<script setup lang="ts">
2+
import { useSidebarItems } from '../composables'
3+
import { SidebarNav } from './SidebarNav'
4+
5+
const sidebarItems = useSidebarItems()
6+
</script>
7+
18
<template>
29
<CSidebar position="fixed" size="lg" class="docs-sidebar border-end px-xl-4 elevation-0">
310
<CSidebarBrand class="justify-content-start ps-3">
@@ -35,24 +42,3 @@
3542
<SidebarNav :items="sidebarItems" />
3643
</CSidebar>
3744
</template>
38-
39-
<script lang="ts">
40-
import { defineComponent } from 'vue'
41-
import { useSidebarItems } from '../composables'
42-
import { SidebarNav } from './SidebarNav'
43-
44-
export default defineComponent({
45-
name: 'Sidebar',
46-
47-
components: {
48-
SidebarNav,
49-
},
50-
51-
setup() {
52-
const sidebarItems = useSidebarItems()
53-
return {
54-
sidebarItems,
55-
}
56-
},
57-
})
58-
</script>

‎packages/docs/.vuepress/src/client/components/Toc.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
<script setup lang="ts">
2+
import { ref } from 'vue'
3+
const visible = ref(false)
4+
const toggleVisible = () => {
5+
visible.value = !visible.value
6+
}
7+
</script>
8+
19
<template>
210
<div class="docs-toc mt-4 mb-5 my-md-0 ps-xl-5 mb-lg-5 text-body-secondary">
311
<button
@@ -27,10 +35,3 @@
2735
</CCollapse>
2836
</div>
2937
</template>
30-
<script setup lang="ts">
31-
import { ref } from 'vue'
32-
const visible = ref(false)
33-
const toggleVisible = () => {
34-
visible.value = !visible.value
35-
}
36-
</script>
Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
<script setup lang="ts">
2+
import { defineComponent } from 'vue'
3+
import { useRouteLocale } from '@vuepress/client'
4+
import { useThemeLocaleData } from '../composables'
5+
6+
const routeLocale = useRouteLocale()
7+
const themeLocale = useThemeLocaleData()
8+
9+
const messages = themeLocale.value.notFound ?? ['Not Found']
10+
const getMsg = (): string => messages[Math.floor(Math.random() * messages.length)]
11+
const homeLink = themeLocale.value.home ?? routeLocale.value
12+
const homeText = themeLocale.value.backToHome ?? 'Back to home'
13+
</script>
14+
115
<template>
216
<div class="theme-container">
317
<div class="theme-default-content">
@@ -9,30 +23,3 @@
923
</div>
1024
</div>
1125
</template>
12-
13-
<script lang="ts">
14-
import { defineComponent } from 'vue'
15-
import { useRouteLocale } from '@vuepress/client'
16-
import { useThemeLocaleData } from '../composables'
17-
18-
export default defineComponent({
19-
name: '404',
20-
21-
setup() {
22-
const routeLocale = useRouteLocale()
23-
const themeLocale = useThemeLocaleData()
24-
25-
const messages = themeLocale.value.notFound ?? ['Not Found']
26-
const getMsg = (): string =>
27-
messages[Math.floor(Math.random() * messages.length)]
28-
const homeLink = themeLocale.value.home ?? routeLocale.value
29-
const homeText = themeLocale.value.backToHome ?? 'Back to home'
30-
31-
return {
32-
getMsg,
33-
homeLink,
34-
homeText,
35-
}
36-
},
37-
})
38-
</script>
Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,3 @@
1-
<template>
2-
<div>
3-
<Sidebar :visible="isSidebarOpen" @visible-change="(event) => (isSidebarOpen = event)" />
4-
<div class="wrapper flex-grow-1">
5-
<Header @toggle-sidebar="toggleSidebar(!isSidebarOpen)" />
6-
<Transition
7-
name="fade-slide-y"
8-
mode="out-in"
9-
@before-enter="onBeforeEnter"
10-
@before-leave="onBeforeLeave"
11-
>
12-
<CContainer class="my-md-4 flex-grow-1" lg>
13-
<main class="docs-main order-1">
14-
<div class="docs-intro ps-lg-4">
15-
<Banner />
16-
<div v-if="name && name !== title" class="d-flex flex-column">
17-
<h1 class="order-2 h5 mb-4 text-body-secondary" id="content">
18-
{{ title }}
19-
</h1>
20-
<h2 class="docs-title order-1 h1">{{ name }}</h2>
21-
</div>
22-
<h1 v-else class="docs-title" id="content">
23-
{{ title }}
24-
</h1>
25-
<p class="docs-lead">{{ description }}</p>
26-
<Ads />
27-
<OtherFrameworks />
28-
</div>
29-
<Toc />
30-
<div className="docs-content ps-lg-4"><Content /></div>
31-
</main>
32-
</CContainer>
33-
</Transition>
34-
<Footer />
35-
</div>
36-
</div>
37-
</template>
38-
391
<script setup lang="ts">
402
import { onMounted, ref } from 'vue'
413
import { usePageFrontmatter } from '@vuepress/client'
@@ -80,3 +42,41 @@ onMounted(() => {
8042
})
8143
})
8244
</script>
45+
46+
<template>
47+
<div>
48+
<Sidebar :visible="isSidebarOpen" @visible-change="(event) => (isSidebarOpen = event)" />
49+
<div class="wrapper flex-grow-1">
50+
<Header @toggle-sidebar="toggleSidebar(!isSidebarOpen)" />
51+
<Transition
52+
name="fade-slide-y"
53+
mode="out-in"
54+
@before-enter="onBeforeEnter"
55+
@before-leave="onBeforeLeave"
56+
>
57+
<CContainer class="my-md-4 flex-grow-1" lg>
58+
<main class="docs-main order-1">
59+
<div class="docs-intro ps-lg-4">
60+
<Banner />
61+
<div v-if="name && name !== title" class="d-flex flex-column">
62+
<h1 class="order-2 h5 mb-4 text-body-secondary" id="content">
63+
{{ title }}
64+
</h1>
65+
<h2 class="docs-title order-1 h1">{{ name }}</h2>
66+
</div>
67+
<h1 v-else class="docs-title" id="content">
68+
{{ title }}
69+
</h1>
70+
<p class="docs-lead">{{ description }}</p>
71+
<Ads />
72+
<OtherFrameworks />
73+
</div>
74+
<Toc />
75+
<div className="docs-content ps-lg-4"><Content /></div>
76+
</main>
77+
</CContainer>
78+
</Transition>
79+
<Footer />
80+
</div>
81+
</div>
82+
</template>
Lines changed: 8 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import type { Page, Theme } from '@vuepress/core'
2-
import { activeHeaderLinksPlugin } from '@vuepress/plugin-active-header-links'
3-
import { backToTopPlugin } from '@vuepress/plugin-back-to-top'
4-
import { prismjsPlugin } from '@vuepress/plugin-prismjs'
2+
53
import { themeDataPlugin } from '@vuepress/plugin-theme-data'
64
import { fs, getDirname, path } from '@vuepress/utils'
7-
import type { DefaultThemeLocaleOptions, DefaultThemePluginsOptions } from '../shared'
5+
import type {
6+
DefaultThemeLocaleOptions,
7+
DefaultThemePageData,
8+
DefaultThemePluginsOptions,
9+
} from '../shared'
810
import { assignDefaultLocaleOptions } from './utils'
911

1012
const __dirname = getDirname(import.meta.url)
@@ -25,17 +27,7 @@ export const defaultTheme = ({
2527
return {
2628
name: '@vuepress/coreui-docs-theme',
2729

28-
templateBuild: path.resolve(__dirname, '../../templates/build.html'),
29-
30-
alias: {
31-
// use alias to make all components replaceable
32-
...Object.fromEntries(
33-
fs
34-
.readdirSync(path.resolve(__dirname, '../client/components'))
35-
.filter((file) => file.endsWith('.vue'))
36-
.map((file) => [`@theme/${file}`, path.resolve(__dirname, '../client/components', file)]),
37-
),
38-
},
30+
templateBuild: path.resolve(__dirname, '../templates/build.html'),
3931

4032
clientConfigFile: path.resolve(__dirname, '../client/config.ts'),
4133

@@ -46,44 +38,6 @@ export const defaultTheme = ({
4638
page.routeMeta.title = page.title
4739
},
4840

49-
// layouts: path.resolve(__dirname, '../client/layouts'),
50-
51-
// clientAppEnhanceFiles: path.resolve(__dirname, '../client/clientAppEnhance.ts'),
52-
53-
// clientAppSetupFiles: path.resolve(__dirname, '../client/clientAppSetup.ts'),
54-
55-
// // use the relative file path to generate edit link
56-
// extendsPageData: ({ filePathRelative }) => ({ filePathRelative }),
57-
58-
plugins: [
59-
// @vuepress/plugin-active-header-link
60-
themePlugins.activeHeaderLinks !== false
61-
? activeHeaderLinksPlugin({
62-
headerLinkSelector: 'a.sidebar-item',
63-
headerAnchorSelector: '.header-anchor',
64-
// should greater than page transition duration
65-
delay: 300,
66-
})
67-
: [],
68-
69-
// @vuepress/plugin-back-to-top
70-
themePlugins.backToTop !== false ? backToTopPlugin() : [],
71-
72-
// @vuepress/plugin-prismjs
73-
themePlugins.prismjs !== false ? prismjsPlugin() : [],
74-
75-
// @vuepress/plugin-theme-data
76-
themeDataPlugin({ themeData: localeOptions }),
77-
// [
78-
// '@vuepress/active-header-links',
79-
// {
80-
// headerLinkSelector: 'a.sidebar-item',
81-
// headerAnchorSelector: '.anchor-link',
82-
// },
83-
// ],
84-
// ['@vuepress/back-to-top', themePlugins.backToTop !== false],
85-
// ['@vuepress/prismjs', themePlugins.prismjs !== false],
86-
// ['@vuepress/theme-data', { themeData: localeOptions }],
87-
],
41+
plugins: [themeDataPlugin({ themeData: localeOptions })],
8842
}
8943
}

‎packages/docs/.vuepress/src/shared/page.ts

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,11 @@ export interface DefaultThemePageFrontmatter {
1010
navbar?: boolean
1111
pageClass?: string
1212
name?: string
13+
pro_component?: boolean
14+
other_frameworks?: string
1315
}
1416

15-
export interface DefaultThemeHomePageFrontmatter
16-
extends DefaultThemePageFrontmatter {
17-
home: true
18-
heroImage?: string
19-
heroAlt?: string
20-
heroText?: string | null
21-
tagline?: string | null
22-
actions?: {
23-
text: string
24-
link: string
25-
type?: 'primary' | 'secondary'
26-
}[]
27-
features?: {
28-
title: string
29-
details: string
30-
}[]
31-
footer?: string
32-
footerHtml?: boolean
33-
}
34-
35-
export interface DefaultThemeNormalPageFrontmatter
36-
extends DefaultThemePageFrontmatter {
17+
export interface DefaultThemeNormalPageFrontmatter extends DefaultThemePageFrontmatter {
3718
home?: false
3819
editLink?: boolean
3920
lastUpdated?: boolean
@@ -42,6 +23,4 @@ export interface DefaultThemeNormalPageFrontmatter
4223
sidebarDepth?: number
4324
prev?: string | NavLink
4425
next?: string | NavLink
45-
pro_component: boolean
46-
other_frameworks?: string
4726
}

‎packages/docs/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"scripts": {
55
"api": "vue-docgen -c build/docgen.config.js",
66
"dev": "vuepress dev --clean-cache",
7-
"build": "vuepress build"
7+
"build": "vuepress build --debug"
88
},
99
"license": "MIT",
1010
"devDependencies": {
@@ -17,14 +17,18 @@
1717
"@docsearch/css": "^3.6.0",
1818
"@docsearch/js": "^3.6.0",
1919
"@vuepress/bundler-vite": "2.0.0-rc.12",
20+
"@vuepress/bundler-webpack": "2.0.0-rc.12",
2021
"@vuepress/plugin-active-header-links": "2.0.0-rc.31",
2122
"@vuepress/plugin-back-to-top": "2.0.0-rc.31",
22-
"@vuepress/plugin-container": "2.0.0-rc.28",
2323
"@vuepress/plugin-git": "2.0.0-rc.31",
24+
"@vuepress/plugin-markdown-container": "2.0.0-rc.30",
2425
"@vuepress/plugin-prismjs": "2.0.0-rc.32",
2526
"@vuepress/plugin-theme-data": "2.0.0-rc.31",
2627
"@vuepress/plugin-register-components": "2.0.0-rc.31",
2728
"@vuepress/plugin-toc": "2.0.0-rc.31",
29+
"@vuepress/shared": "2.0.0-rc.12",
30+
"@vuepress/utils": "2.0.0-rc.12",
31+
"markdown-it-anchor": "^9.0.1",
2832
"markdown-it-include": "^2.0.0",
2933
"sass": "^1.77.2",
3034
"vue-docgen-cli": "^4.79.0",

0 commit comments

Comments
 (0)
Please sign in to comment.