提交 9693ae10 编写于 作者: U ULIVZ

chore: move all docs to sub dir

上级 78925562
......@@ -4,6 +4,7 @@ const yamlParser = require('js-yaml')
const tomlParser = require('toml')
module.exports = function loadConfig (vuepressDir, bustCache = true) {
console.log(vuepressDir)
const configPath = path.resolve(vuepressDir, 'config.js')
const configYmlPath = path.resolve(vuepressDir, 'config.yml')
const configTomlPath = path.resolve(vuepressDir, 'config.toml')
......
......@@ -42,6 +42,8 @@ module.exports = async function resolveOptions (sourceDir) {
let themeLayoutPath = null
let themeNotFoundPath = null
console.log(useDefaultTheme)
console.log(siteConfig)
if (useDefaultTheme) {
// use default theme
themePath = defaultThemePath
......@@ -51,6 +53,7 @@ module.exports = async function resolveOptions (sourceDir) {
// resolve theme Layout
if (siteConfig.theme) {
// use external theme
// backward-compatible
try {
themeLayoutPath = require.resolve(`vuepress-theme-${siteConfig.theme}/Layout.vue`, {
paths: [
......
......@@ -3,9 +3,6 @@ const path = require('path')
// Theme API.
module.exports = {
layout: path.resolve(__dirname, 'src/Layout.vue'),
404: path.resolve(__dirname, 'src/NotFound.vue'),
chainWebpack (config, isServer) {
},
notFound: path.resolve(__dirname, 'src/NotFound.vue'),
plugins: []
}
......@@ -2,19 +2,7 @@
"name": "@vuepress/theme-default",
"version": "1.0.0",
"description": "Default theme for VuePress",
"main": "lib/index.js",
"bin": {
"vuepress": "bin/vuepress.js"
},
"scripts": {
"boot": "node scripts/bootstrap.js",
"dev": "node bin/vuepress dev docs",
"build": "node bin/vuepress build docs",
"lint": "eslint --fix --ext .js,.vue bin/ lib/ test/",
"prepublishOnly": "conventional-changelog -p angular -r 2 -i CHANGELOG.md -s",
"release": "/bin/bash scripts/release.sh",
"test": "node test/prepare.js && jest --config test/jest.config.js"
},
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vuepress.git"
......@@ -38,85 +26,5 @@
"eslint --fix",
"git add"
]
},
"dependencies": {
"@babel/core": "7.0.0-beta.47",
"@vue/babel-preset-app": "3.0.0-beta.11",
"autoprefixer": "^8.2.0",
"babel-loader": "8.0.0-beta.3",
"cache-loader": "^1.2.2",
"chalk": "^2.3.2",
"chokidar": "^2.0.3",
"commander": "^2.15.1",
"connect-history-api-fallback": "^1.5.0",
"copy-webpack-plugin": "^4.5.1",
"cross-spawn": "^6.0.5",
"css-loader": "^0.28.11",
"diacritics": "^1.3.0",
"docsearch.js": "^2.5.2",
"escape-html": "^1.0.3",
"file-loader": "^1.1.11",
"fs-extra": "^5.0.0",
"globby": "^8.0.1",
"gray-matter": "^4.0.1",
"js-yaml": "^3.11.0",
"koa-connect": "^2.0.1",
"koa-mount": "^3.0.0",
"koa-range": "^0.3.0",
"koa-static": "^4.0.2",
"loader-utils": "^1.1.0",
"lodash.throttle": "^4.1.1",
"lru-cache": "^4.1.2",
"markdown-it": "^8.4.1",
"markdown-it-anchor": "^5.0.2",
"markdown-it-container": "^2.0.0",
"markdown-it-emoji": "^1.4.0",
"markdown-it-table-of-contents": "^0.4.0",
"mini-css-extract-plugin": "^0.4.1",
"nprogress": "^0.2.0",
"optimize-css-assets-webpack-plugin": "^4.0.0",
"portfinder": "^1.0.13",
"postcss-loader": "^2.1.5",
"prismjs": "^1.13.0",
"register-service-worker": "^1.4.1",
"semver": "^5.5.0",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"toml": "^2.3.3",
"url-loader": "^1.0.1",
"vue": "^2.5.16",
"vue-loader": "^15.2.4",
"vue-router": "^3.0.1",
"vue-server-renderer": "^2.5.16",
"vue-template-compiler": "^2.5.16",
"vuepress-html-webpack-plugin": "^3.2.0",
"webpack": "^4.8.1",
"webpack-chain": "^4.6.0",
"webpack-merge": "^4.1.2",
"webpack-serve": "^1.0.2",
"webpackbar": "^2.6.1",
"workbox-build": "^3.1.0"
},
"devDependencies": {
"@vue/test-utils": "^1.0.0-beta.16",
"babel-core": "^7.0.0-0",
"babel-jest": "^23.0.0",
"conventional-changelog-cli": "^1.3.22",
"eslint": "^4.19.1",
"eslint-plugin-jest": "^21.15.1",
"eslint-plugin-vue-libs": "^3.0.0",
"jest": "^23.0.0",
"jest-serializer-vue": "^1.0.0",
"lerna": "^2.11.0",
"lint-staged": "^7.0.4",
"vue-jest": "^2.6.0",
"vuepress-theme-vue": "^1.1.0",
"yorkie": "^1.0.3"
},
"engines": {
"node": ">=8"
},
"browserslist": [
">1%"
]
}
}
const testPlugin = require('../../@vuepress/plugin-test/index')
const translationComparisonPlugin = require('../../../../vuepress-plugin-translation-ui/src/index')
const testPlugin = require('../../../@vuepress/plugin-test/index')
const translationComparisonPlugin = require('../../../../../vuepress-plugin-translation-ui/src/index')
module.exports = {
dest: 'vuepress',
......
......@@ -12,7 +12,7 @@ All options listed on this page apply to the default theme only. If you are usin
## Homepage
The default theme provides a homepage layout (which is used on [the homepage of this very website](../README.md)). To use it, specify `home: true` plus some other metadata in your root `README.md`'s [YAML front matter](../guide/markdown.md#front-matter). This is the actual data used on this site:
The default theme provides a homepage layout (which is used on [the homepage of this very website](../../README.md)). To use it, specify `home: true` plus some other metadata in your root `README.md`'s [YAML front matter](../guide/markdown.md#front-matter). This is the actual data used on this site:
``` yaml
---
......
......@@ -16,13 +16,13 @@ Each markdown file is compiled into HTML with [markdown-it](https://github.com/m
## Features
- [Built-in markdown extensions](./markdown.md) optimized for technical documentation
- [Ability to leverage Vue inside markdown files](./using-vue.md)
- [Vue-powered custom theme system](./custom-themes.md)
- [Built-in markdown extensions](markdown.md) optimized for technical documentation
- [Ability to leverage Vue inside markdown files](using-vue.md)
- [Vue-powered custom theme system](custom-themes.md)
- [Automatic Service Worker generation](../config/README.md#serviceworker)
- [Google Analytics Integration](../config/README.md#ga)
- ["Last Updated" based on Git](../default-theme-config/README.md#last-updated)
- [Multi-language support](./i18n.md)
- [Multi-language support](i18n.md)
- A default theme with:
- Responsive layout
- [Optional Homepage](../default-theme-config/README.md#homepage)
......
......@@ -34,7 +34,7 @@ You can also use YAML (`.vuepress/config.yml`) or TOML (`.vuepress/config.toml`)
A VuePress theme is responsible for all the layout and interactivity details of your site. VuePress ships with a default theme (you are looking at it right now) which is designed for technical documentation. It exposes a number of options that allow you to customize the navbar, sidebar and homepage, etc. For details, check out the [Default Theme Config](../default-theme-config/README.md) page.
If you wish to develop a custom theme, see [Custom Themes](./custom-themes.md).
If you wish to develop a custom theme, see [Custom Themes](custom-themes.md).
## App Level Enhancements
......
......@@ -63,4 +63,4 @@ To generate static assets, run:
yarn docs:build # Or npm run docs:build
```
By default the built files will be in `.vuepress/dist`, which can be configured via the `dest` field in `.vuepress/config.js`. The built files can be deployed to any static file server. See [Deployment Guide](./deploy.md) for guides on deploying to popular services.
By default the built files will be in `.vuepress/dist`, which can be configured via the `dest` field in `.vuepress/config.js`. The built files can be deployed to any static file server. See [Deployment Guide](deploy.md) for guides on deploying to popular services.
......@@ -12,13 +12,13 @@ VuePress 由两部分组成:一部分是支持用 Vue 开发主题的极简静
## 特性
- 为技术文档而优化的 [内置 Markdown 拓展](./markdown.md)
- [在 Markdown 文件中使用 Vue 组件的能力](./using-vue.md)
- [Vue 驱动的自定义主题系统](./custom-themes.md)
- 为技术文档而优化的 [内置 Markdown 拓展](markdown.md)
- [在 Markdown 文件中使用 Vue 组件的能力](using-vue.md)
- [Vue 驱动的自定义主题系统](custom-themes.md)
- [自动生成 Service Worker](../config/README.md#serviceworker)
- [Google Analytics 集成](../config/README.md#ga)
- [基于 Git 的 “最后更新时间”](../default-theme-config/README.md#最后更新时间)
- [多语言支持](./i18n.md)
- [多语言支持](i18n.md)
- 默认主题包含:
- 响应式布局
- [可选的主页](../default-theme-config/README.md#首页)
......
......@@ -34,7 +34,7 @@ module.exports = {
一个 VuePress 主题应该负责整个网站的布局和交互细节。在 VuePress 中,目前自带了一个默认的主题(正是你现在所看到的),它是为技术文档而设计的。同时,默认主题提供了一些选项,让你可以去自定义导航栏(navbar)、 侧边栏(sidebar)和 首页(homepage) 等,详情请参见 [默认主题](../default-theme-config/README.md)
如果你想开发一个自定义主题,可以参考 [自定义主题](./custom-themes.md)
如果你想开发一个自定义主题,可以参考 [自定义主题](custom-themes.md)
## 应用级别的配置
......
......@@ -67,4 +67,4 @@ yarn docs:dev # 或者:npm run docs:dev
yarn docs:build # 或者:npm run docs:build
```
默认情况下,文件将会被生成在 `.vuepress/dist`,当然,你也可以通过 `.vuepress/config.js` 中的 `dest` 字段来修改,生成的文件可以部署到任意的静态文件服务器上,参考 [部署](./deploy.md) 来了解更多。
默认情况下,文件将会被生成在 `.vuepress/dist`,当然,你也可以通过 `.vuepress/config.js` 中的 `dest` 字段来修改,生成的文件可以部署到任意的静态文件服务器上,参考 [部署](deploy.md) 来了解更多。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册