Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

[文档|Docs]: 中文文档翻译 | Chinese Documentation Translation #201

Merged
merged 2 commits into from
May 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
]
},
"scripts": {
"postinstall": "yarn test && yarn build:dev && yarn theme:dev && lerna link",
"build:dev": "yarn workspace @chakra-ui/vue run rollup --config rollup.dev.config.js",
"build": "yarn workspace @chakra-ui/vue build",
"dev": "yarn workspace @chakra-ui/vue dev",
"lint": "vue-cli-service lint",
Expand All @@ -31,7 +33,7 @@
"bootstrap": "lerna bootstrap --use-workspaces",
"deploy-storybook": "storybook-to-ghpages -- --out=.out",
"now-build-storybook": "build-storybook -o dist/storybook",
"docs:dev": "yarn theme:dev && yarn docs-dev",
"docs:dev": "yarn docs-dev",
"theme:dev": "yarn workspace @chakra-ui/theme-vue build",
"docs-dev": "yarn workspace chakra-ui-docs dev",
"evalbundle": "bundlesize"
Expand Down Expand Up @@ -108,7 +110,7 @@
"mixpanel-browser": "^2.36.0",
"node-fetch": "^2.6.0",
"node-sass": "^4.13.1",
"nuxt": "^2.0.0",
"nuxt": "^2.12.2",
"portal-vue": "^2.1.6",
"prismjs": "^1.19.0",
"register-service-worker": "^1.6.2",
Expand Down
26 changes: 26 additions & 0 deletions packages/chakra-ui-docs/modules/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export default async function buildRoutes (options = {}) {
this.options.build.additionalExtensions = ['mdx']

if (this.options.extensions) {
const extensions = this.options.extensions
!extensions.includes('mdx') && extensions.push('mdx')

this.options.build.additionalExtensions = ['mdx']

this.extendBuild((config) => {
if (config.resolve.extensions) {
config.resolve.extensions.push('.mdx')
} else {
config.resolve.extensions = ['.mdx']
}

config.module.rules.push({
test: /\.mdx$/,
use: [
'babel-loader',
'mdx-vue-loader'
]
})
})
}
}
32 changes: 14 additions & 18 deletions packages/chakra-ui-docs/nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import dotenv from 'dotenv-defaults'
import { stringToUrl } from './utils'
import pages from './utils/all-routes'

const routes = pages
.map(page => {
return page === 'Index' ? stringToUrl('') : stringToUrl(page)
})

// Configuring dotenv variables.
dotenv.config({
Expand All @@ -15,10 +8,10 @@ dotenv.config({

export default {
mode: 'universal',
srcDir: __dirname,
generate: {
routes
options: {
target: 'static'
},
srcDir: __dirname,
head: {
title: 'Chakra UI Vue | Simple, Modular and Accessible UI Components for your Vue Applications.',
meta: [
Expand Down Expand Up @@ -52,8 +45,11 @@ export default {
ssr: 'critical'
}],
'@nuxtjs/pwa',
'@nuxtjs/router'
'modules/routes'
],
router: {
prefetchLinks: true
},
pwa: {
meta: {
name: 'Chakra UI Vue',
Expand All @@ -66,20 +62,20 @@ export default {
iconFileName: 'chakra.png'
}
},
extensions: [
'mdx'
],
build: {
transpile: [
'vue-lorem-ipsum',
'@chakra-ui/vue',
'@chakra-ui/theme-vue'
],
additionalExtensions: [
'.mdx'
],
extend (config, ctx) {
config.resolve.alias.vue = 'vue/dist/vue.common'
config.module.rules.push({
test: /\.mdx$/,
use: [
'babel-loader',
'mdx-vue-loader'
]
})
}
}
}
4 changes: 3 additions & 1 deletion packages/chakra-ui-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"scripts": {
"dev": "nuxt",
"build": "nuxt generate --max_old_space_size=8000",
"build-static":"nuxt build --target static",
"export": "nuxt export",
"start": "nuxt start --max_old_space_size=8000",
"docs:build": "nuxt ",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore ."
Expand Down Expand Up @@ -43,7 +45,7 @@
"mdx-vue-loader": "^1.0.2",
"mixpanel-browser": "^2.36.0",
"node-sass": "^4.13.1",
"nuxt": "^2.0.0",
"nuxt": "^2.12.2",
"prismjs": "^1.19.0",
"sass-loader": "^8.0.2",
"vue": "^2.6.11",
Expand Down
2 changes: 2 additions & 0 deletions packages/chakra-ui-docs/pages/zh/accessibility.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# 可访问性

42 changes: 0 additions & 42 deletions packages/chakra-ui-docs/router.js

This file was deleted.

Loading