From 136a56e74dbf75f65bd8e634a1349c281641af8c Mon Sep 17 00:00:00 2001 From: Kia King Ishii Date: Wed, 25 Nov 2020 19:33:01 +0900 Subject: [PATCH 1/2] docs: add basic config reference --- docs/.vitepress/config.js | 9 +++++-- docs/config/basics.md | 57 +++++++++++++++++++++++++++++++++++++++ docs/config/index.md | 3 --- 3 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 docs/config/basics.md delete mode 100644 docs/config/index.md diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index 81297dc3..10e44a51 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -13,7 +13,7 @@ module.exports = { nav: [ { text: 'Guide', link: '/' }, - { text: 'Config Reference', link: '/config/' }, + { text: 'Config Reference', link: '/config/basics' }, { text: 'Release Notes', link: 'https://github.com/vuejs/vitepress/releases' @@ -51,5 +51,10 @@ function getGuideSidebar() { } function getConfigSidebar() { - return [{ text: 'Config Reference', link: '/config/' }] + return [ + { + text: 'App Config', + children: [{ text: 'Basics', link: '/config/basics' }] + } + ] } diff --git a/docs/config/basics.md b/docs/config/basics.md new file mode 100644 index 00000000..b9b03a33 --- /dev/null +++ b/docs/config/basics.md @@ -0,0 +1,57 @@ +# App Config: Basics + +## base + +- Type: `string` +- Default: `/` + +The base URL the site will be deployed at. You will need to set this if you plan to deploy your site under a sub path, for example, GitHub pages. If you plan to deploy your site to `https://foo.github.io/bar/`, then you should set base to `'/bar/'`. It should always start and end with a slash. + +The `base` is automatically prepended to all the URLs that start with `/` in other options, so you only need to specify it once. + +```js +module.exports = { + base: '/base/' +} +``` + +## lang + +- Type: `string` +- Default: `en-US` + +The `lang` attribute for the site. This will render as a `` tag in the page HTML. + +Note that the `lang` attribute will only be added when building the site via `vitepress build`. You will not see this rendered during `vitepress dev`. + +```js +module.exports = { + lang: 'en-US' +} +``` + +## title + +- Type: `string` +- Default: `VitePress` + +Title for the site. This will be the prefix for all page titles, and displayed in the navbar. + +```js +module.exports = { + title: 'VitePress' +} +``` + +## Description + +- Type: `string` +- Default: `A VitePress site` + +Description for the site. This will render as a `` tag in the page HTML. + +```js +module.exports = { + title: 'A VitePress site' +} +``` diff --git a/docs/config/index.md b/docs/config/index.md deleted file mode 100644 index 17e6b881..00000000 --- a/docs/config/index.md +++ /dev/null @@ -1,3 +0,0 @@ -# Config Reference - -Coming soon... From b127aeeaf17e1da1c20f0292fe9ee01423ddb5c1 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 26 Nov 2020 04:15:29 -0500 Subject: [PATCH 2/2] refactor: migrate default theme to use script-setup (#137) Co-authored-by: Kia King Ishii --- package.json | 8 +- src/client/theme-default/Layout.vue | 112 ++- src/client/theme-default/NotFound.vue | 18 +- .../theme-default/components/EditLink.vue | 18 +- src/client/theme-default/components/Home.vue | 70 +- .../theme-default/components/NavBar.vue | 10 +- .../theme-default/components/NavBarLink.ts | 77 -- .../theme-default/components/NavBarLink.vue | 58 +- .../theme-default/components/NavBarLinks.ts | 101 --- .../theme-default/components/NavBarLinks.vue | 89 +- .../components/NavDropdownLink.ts | 42 - .../components/NavDropdownLink.vue | 43 +- .../components/NextAndPrevLinks.vue | 31 +- src/client/theme-default/components/Page.vue | 10 +- .../theme-default/components/SideBar.vue | 17 +- .../theme-default/components/SideBarLinks.vue | 23 +- src/node/build/build.ts | 4 + src/node/build/bundle.ts | 33 +- src/node/markdownToVue.ts | 9 +- yarn.lock | 779 +++++++++--------- 20 files changed, 690 insertions(+), 862 deletions(-) delete mode 100644 src/client/theme-default/components/NavBarLink.ts delete mode 100644 src/client/theme-default/components/NavBarLinks.ts delete mode 100644 src/client/theme-default/components/NavDropdownLink.ts diff --git a/package.json b/package.json index 250a158b..5dfb6405 100644 --- a/package.json +++ b/package.json @@ -62,8 +62,8 @@ "url": "https://github.com/vuejs/vitepress/issues" }, "dependencies": { - "@vue/compiler-sfc": "^3.0.2", - "@vue/server-renderer": "^3.0.2", + "@vue/compiler-sfc": "^3.0.3", + "@vue/server-renderer": "^3.0.3", "chalk": "^4.1.0", "debug": "^4.1.1", "diacritics": "^1.3.0", @@ -82,8 +82,8 @@ "prismjs": "^1.20.0", "rollup": "^2.33.3", "slash": "^3.0.0", - "vite": "^1.0.0-rc.9", - "vue": "^3.0.2" + "vite": "^1.0.0-rc.13", + "vue": "^3.0.3" }, "devDependencies": { "@types/fs-extra": "^9.0.1", diff --git a/src/client/theme-default/Layout.vue b/src/client/theme-default/Layout.vue index 12834237..6b3f9443 100644 --- a/src/client/theme-default/Layout.vue +++ b/src/client/theme-default/Layout.vue @@ -45,7 +45,7 @@ - diff --git a/src/client/theme-default/NotFound.vue b/src/client/theme-default/NotFound.vue index 8131e20a..e797d7b3 100644 --- a/src/client/theme-default/NotFound.vue +++ b/src/client/theme-default/NotFound.vue @@ -2,15 +2,11 @@

404

{{ getMsg() }}
- - Take me home. - + Take me home.
- diff --git a/src/client/theme-default/components/EditLink.vue b/src/client/theme-default/components/EditLink.vue index 54d9dd71..f1587574 100644 --- a/src/client/theme-default/components/EditLink.vue +++ b/src/client/theme-default/components/EditLink.vue @@ -6,25 +6,11 @@ - diff --git a/src/client/theme-default/components/Page.vue b/src/client/theme-default/components/Page.vue index 910d1042..9b0d205a 100644 --- a/src/client/theme-default/components/Page.vue +++ b/src/client/theme-default/components/Page.vue @@ -14,17 +14,9 @@ -