| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- import consola from 'consola'
- import { REPO_BRANCH, REPO_PATH } from '@kankan-components/build-constants'
- import { docsDirName } from '@kankan-components/build-utils'
- // import { languages } from './utils/lang'
- import { features, head, mdPlugin, nav, sidebars } from './config'
- 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 languages = ['zh-CN']
- const locales = {
- // '/en-US': { label: 'en-US', lang: 'en-US' },
- '/zh-CN': { label: 'zh-CN', lang: 'zh-CN' },
- }
- // languages.forEach(lang => {
- // locales[`/${lang}`] = {
- // label: lang,
- // lang,
- // }
- // })
- // consola.log('locales', locales)
- // consola.log('sidebars', sidebars)
- export const config: UserConfig = {
- title: '看看公共组件',
- description: '看看组件公共文档中心',
- lastUpdated: true,
- head,
- themeConfig: {
- repo: 'http://192.168.0.115:3000/4dkankan/4dkankan-components',
- docsBranch: REPO_BRANCH,
- docsDir: docsDirName,
- editLinks: true,
- editLinkText: 'Edit this page on GitHub',
- lastUpdated: 'Last Updated',
- logo: '/images/logo.png',
- logoSmall: '/images/kankan_icon.ico',
- 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
|