mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-04 20:27:44 +08:00
851242e317
* feat(docs): add source and contributors closes #6038 * feat(docs): ignore contributor when dev * ci: add github token * fix: lint * fix: page * fix: placeholder * ci: remove preview
90 lines
1.7 KiB
TypeScript
90 lines
1.7 KiB
TypeScript
import consola from 'consola'
|
|
import { languages } from './utils/lang'
|
|
import { head } from './config/head'
|
|
import { sidebars } from './config/sidebars'
|
|
import { nav } from './config/nav'
|
|
import { mdPlugin } from './config/plugins'
|
|
import { features } from './config/features'
|
|
import { branch, docsDir, repo } from './vitepress/constant'
|
|
import type { UserConfig } from 'vitepress'
|
|
|
|
const buildTransformers = () => {
|
|
const transformer = () => {
|
|
return {
|
|
props: [],
|
|
needRuntime: true,
|
|
}
|
|
}
|
|
|
|
const transformers = {}
|
|
const directives = [
|
|
'infinite-scroll',
|
|
'loading',
|
|
'popover',
|
|
'click-outside',
|
|
'repeat-click',
|
|
'trap-focus',
|
|
'mousewheel',
|
|
'resize',
|
|
]
|
|
directives.forEach((k) => {
|
|
transformers[k] = transformer
|
|
})
|
|
|
|
return transformers
|
|
}
|
|
|
|
consola.debug(`DOC_ENV: ${process.env.DOC_ENV}`)
|
|
|
|
const locales = {}
|
|
languages.forEach((lang) => {
|
|
locales[`/${lang}`] = {
|
|
label: lang,
|
|
lang,
|
|
}
|
|
})
|
|
|
|
export const config: UserConfig = {
|
|
title: 'Element Plus',
|
|
description: 'a Vue 3 based component library for designers and developers',
|
|
lastUpdated: true,
|
|
head,
|
|
themeConfig: {
|
|
repo,
|
|
branch,
|
|
docsDir,
|
|
|
|
editLinks: true,
|
|
editLinkText: 'Edit this page on GitHub',
|
|
lastUpdated: 'Last Updated',
|
|
|
|
logo: '/images/element-plus-logo.svg',
|
|
logoSmall: '/images/element-plus-logo-small.svg',
|
|
sidebars,
|
|
nav,
|
|
agolia: {
|
|
apiKey: '377f2b647a96d9b1d62e4780f2344da2',
|
|
appId: 'BH4D9OD16A',
|
|
},
|
|
features,
|
|
langs: languages,
|
|
},
|
|
|
|
locales,
|
|
|
|
markdown: {
|
|
config: (md) => mdPlugin(md),
|
|
},
|
|
|
|
vue: {
|
|
template: {
|
|
ssr: true,
|
|
compilerOptions: {
|
|
directiveTransforms: buildTransformers(),
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
export default config
|