Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/vuepress
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.0-alpha.36
Choose a base ref
...
head repository: vuejs/vuepress
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.0.0-alpha.37
Choose a head ref
  • 9 commits
  • 34 files changed
  • 4 contributors

Commits on Feb 3, 2019

  1. Copy the full SHA
    055d680 View commit details

Commits on Feb 7, 2019

  1. Copy the full SHA
    f500928 View commit details
  2. Copy the full SHA
    e4f5c7f View commit details
  3. Copy the full SHA
    78cc60d View commit details

Commits on Feb 8, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    213bb34 View commit details
  2. feat($theme-default): highlight sidebar link text at root level like …

    …sidebar group heading text
    ulivz committed Feb 8, 2019
    Copy the full SHA
    05e793f View commit details
  3. feat($theme-default): unify the text color of sidebar heading text an…

    …d root-level sidebar link
    ulivz committed Feb 8, 2019
    Copy the full SHA
    3e47a20 View commit details
  4. Copy the full SHA
    11ce576 View commit details
  5. v1.0.0-alpha.37

    ulivz committed Feb 8, 2019
    Copy the full SHA
    fafb9ae View commit details
Showing with 148 additions and 75 deletions.
  1. +18 −0 CHANGELOG.md
  2. +1 −1 lerna.json
  3. +2 −10 packages/@vuepress/core/lib/app/app.js
  4. +54 −0 packages/@vuepress/core/lib/app/redirect.js
  5. +6 −6 packages/@vuepress/core/package.json
  6. +2 −2 packages/@vuepress/markdown-loader/package.json
  7. +2 −2 packages/@vuepress/markdown/package.json
  8. +1 −1 packages/@vuepress/plugin-active-header-links/package.json
  9. +1 −1 packages/@vuepress/plugin-back-to-top/package.json
  10. +1 −1 packages/@vuepress/plugin-blog/package.json
  11. +1 −1 packages/@vuepress/plugin-google-analytics/package.json
  12. +1 −1 packages/@vuepress/plugin-i18n-ui/package.json
  13. +1 −1 packages/@vuepress/plugin-last-updated/package.json
  14. +1 −1 packages/@vuepress/plugin-medium-zoom/package.json
  15. +1 −1 packages/@vuepress/plugin-notification/package.json
  16. +1 −1 packages/@vuepress/plugin-nprogress/package.json
  17. +1 −1 packages/@vuepress/plugin-pagination/package.json
  18. +2 −2 packages/@vuepress/plugin-pwa/package.json
  19. +2 −2 packages/@vuepress/plugin-register-components/package.json
  20. +1 −1 packages/@vuepress/plugin-search/package.json
  21. +1 −1 packages/@vuepress/shared-utils/package.json
  22. +3 −3 packages/@vuepress/test-utils/package.json
  23. +5 −5 packages/@vuepress/theme-blog/package.json
  24. +4 −0 packages/@vuepress/theme-default/components/Sidebar.vue
  25. +1 −1 packages/@vuepress/theme-default/components/SidebarGroup.vue
  26. +4 −4 packages/@vuepress/theme-default/package.json
  27. +5 −0 packages/@vuepress/theme-default/util/index.js
  28. +2 −2 packages/@vuepress/theme-vue/package.json
  29. +3 −3 packages/blog/package.json
  30. +1 −1 packages/docs/docs/theme/default-theme-config.md
  31. +1 −1 packages/docs/docs/zh/guide/markdown.md
  32. +6 −6 packages/docs/docs/zh/plugin/official/plugin-medium-zoom.md
  33. +9 −9 packages/docs/package.json
  34. +3 −3 packages/vuepress/package.json
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
<a name="1.0.0-alpha.36"></a>
# [1.0.0-alpha.36](https://github.com/vuejs/vuepress/compare/v1.0.0-alpha.35...v1.0.0-alpha.36) (2019-02-03)


### Bug Fixes

* **$core:** SFC page compile error (close: [#1110](https://github.com/vuejs/vuepress/issues/1110)) ([8f5b0cd](https://github.com/vuejs/vuepress/commit/8f5b0cd))


### Features

* **$theme-default:** refine sidebar groups ([#1257](https://github.com/vuejs/vuepress/issues/1257)) ([01dd45b](https://github.com/vuejs/vuepress/commit/01dd45b)), closes [#814](https://github.com/vuejs/vuepress/issues/814) [#783](https://github.com/vuejs/vuepress/issues/783) [#287](https://github.com/vuejs/vuepress/issues/287)
- `sidebarDepth` for a specified sidebar group.
- Nested sidebar groups.
- Clickable heading for sidebar groups.



<a name="1.0.0-alpha.35"></a>
# [1.0.0-alpha.35](https://github.com/vuejs/vuepress/compare/v1.0.0-alpha.34...v1.0.0-alpha.35) (2019-01-30)

2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -2,5 +2,5 @@
"lerna": "2.5.1",
"npmClient": "yarn",
"useWorkspaces": true,
"version": "1.0.0-alpha.36"
"version": "1.0.0-alpha.37"
}
12 changes: 2 additions & 10 deletions packages/@vuepress/core/lib/app/app.js
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ import appEnhancers from '@internal/app-enhancers'
import globalUIComponents from '@internal/global-ui'
import ClientComputedMixin from '@transform/ClientComputedMixin'
import VuePress from './plugins/VuePress'
import { handleRedirectForCleanUrls } from './redirect.js'

// built-in components
import Content from './components/Content.js'
@@ -74,16 +75,7 @@ export function createApp (isServer) {
}
})

// redirect /foo to /foo/
router.beforeEach((to, from, next) => {
if (!/(\/|\.html)$/.test(to.path)) {
next(Object.assign({}, to, {
path: to.path + '/'
}))
} else {
next()
}
})
handleRedirectForCleanUrls(router)

const options = {}

54 changes: 54 additions & 0 deletions packages/@vuepress/core/lib/app/redirect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// In VuePress, we have following convention about routing:
//
// - `/foo/` means source file is `/foo/{README|index}.md`
// - `/foo.html` means your source file is `/foo.md`
//
// The original design of VuePress relied on above two styles
// of routing, especially the calculation involved of routes at
// default theme. so we can't easily modify `/foo.html` directly
// to `/foo` (i.e. remove html suffix)
//
// This "temporary" utility handles redirect of clean urls, with
// this utility, you'll get:
//
// For unknown request `/foo`
// - redirect to `/foo.html` if it exists
// - redirect to `/foo/` if it exists
//
// For unknown request `/foo/`
// - redirect to `/foo.html` if it exists
//
// If all the above redirect rules don't exist, you'll get a 404

export function handleRedirectForCleanUrls (router) {
router.beforeEach((to, from, next) => {
if (isRouteExists(router, to.path)) {
next()
} else {
if (!/(\/|\.html)$/.test(to.path)) {
const endingSlashUrl = to.path + '/'
const endingHtmlUrl = to.path + '.html'
if (isRouteExists(router, endingHtmlUrl)) {
next(endingHtmlUrl)
} else if (isRouteExists(router, endingSlashUrl)) {
next(endingSlashUrl)
} else {
next()
}
} else if (/\/$/.test(to.path)) {
const endingHtmlUrl = to.path.replace(/\/$/, '') + '.html'
if (isRouteExists(router, endingHtmlUrl)) {
next(endingHtmlUrl)
} else {
next()
}
} else {
next()
}
}
})
}

function isRouteExists (router, path) {
return router.options.routes.filter(route => route.path === path).length > 0
}
12 changes: 6 additions & 6 deletions packages/@vuepress/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/core",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "Minimalistic doc generator with Vue component based layout system",
"main": "lib/index.js",
"repository": {
@@ -31,11 +31,11 @@
"dependencies": {
"@babel/core": "^7.0.0",
"@vue/babel-preset-app": "^3.1.1",
"@vuepress/markdown": "^1.0.0-alpha.36",
"@vuepress/markdown-loader": "^1.0.0-alpha.36",
"@vuepress/plugin-last-updated": "^1.0.0-alpha.36",
"@vuepress/plugin-register-components": "^1.0.0-alpha.36",
"@vuepress/shared-utils": "^1.0.0-alpha.36",
"@vuepress/markdown": "^1.0.0-alpha.37",
"@vuepress/markdown-loader": "^1.0.0-alpha.37",
"@vuepress/plugin-last-updated": "^1.0.0-alpha.37",
"@vuepress/plugin-register-components": "^1.0.0-alpha.37",
"@vuepress/shared-utils": "^1.0.0-alpha.37",
"autoprefixer": "^7.1.2",
"babel-loader": "^8.0.4",
"cache-loader": "^1.2.2",
4 changes: 2 additions & 2 deletions packages/@vuepress/markdown-loader/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/markdown-loader",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "markdown-loader for vuepress",
"main": "index.js",
"publishConfig": {
@@ -18,7 +18,7 @@
"generator"
],
"dependencies": {
"@vuepress/markdown": "^1.0.0-alpha.36",
"@vuepress/markdown": "^1.0.0-alpha.37",
"loader-utils": "^1.1.0"
},
"author": "Evan You",
4 changes: 2 additions & 2 deletions packages/@vuepress/markdown/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/markdown",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "markdown for vuepress",
"main": "index.js",
"publishConfig": {
@@ -19,7 +19,7 @@
"markdown"
],
"dependencies": {
"@vuepress/shared-utils": "^1.0.0-alpha.36",
"@vuepress/shared-utils": "^1.0.0-alpha.37",
"markdown-it": "^8.4.1",
"markdown-it-anchor": "^5.0.2",
"markdown-it-chain": "^1.3.0",
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-active-header-links/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-active-header-links",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "active-header-links plugin for vuepress",
"main": "index.js",
"publishConfig": {
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-back-to-top/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-back-to-top",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "back-to-top plugin for vuepress",
"main": "index.js",
"publishConfig": {
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-blog/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-blog",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "blog plugin for vuepress",
"main": "index.js",
"publishConfig": {
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-google-analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-google-analytics",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "google-analytics plugin for vuepress",
"main": "index.js",
"publishConfig": {
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-i18n-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-i18n-ui",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "i18n-ui plugin for vuepress",
"main": "index.js",
"publishConfig": {
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-last-updated/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-last-updated",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "last-updated plugin for vuepress",
"main": "index.js",
"publishConfig": {
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-medium-zoom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-medium-zoom",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "medium-zoom plugin for vuepress",
"main": "index.js",
"publishConfig": {
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-notification/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-notification",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "notification plugin for vuepress",
"main": "index.js",
"publishConfig": {
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-nprogress/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-nprogress",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "nprogress plugin for vuepress",
"main": "index.js",
"publishConfig": {
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-pagination/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-pagination",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "pagination plugin for vuepress",
"main": "index.js",
"publishConfig": {
4 changes: 2 additions & 2 deletions packages/@vuepress/plugin-pwa/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-pwa",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "pwa plugin for vuepress",
"main": "index.js",
"publishConfig": {
@@ -18,7 +18,7 @@
"generator"
],
"dependencies": {
"@vuepress/shared-utils": "^1.0.0-alpha.36",
"@vuepress/shared-utils": "^1.0.0-alpha.37",
"register-service-worker": "^1.5.2",
"workbox-build": "^3.1.0"
},
4 changes: 2 additions & 2 deletions packages/@vuepress/plugin-register-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-register-components",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "register-global-components plugin for vuepress",
"main": "index.js",
"publishConfig": {
@@ -24,6 +24,6 @@
},
"homepage": "https://github.com/vuejs/vuepress/packages/@vuepress/plugin-register-components#readme",
"dependencies": {
"@vuepress/shared-utils": "^1.0.0-alpha.36"
"@vuepress/shared-utils": "^1.0.0-alpha.37"
}
}
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-search/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-search",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "search plugin for vuepress",
"main": "index.js",
"publishConfig": {
2 changes: 1 addition & 1 deletion packages/@vuepress/shared-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/shared-utils",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "shared-utils for vuepress",
"main": "lib/index.js",
"types": "types/index.d.ts",
6 changes: 3 additions & 3 deletions packages/@vuepress/test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/test-utils",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "test-utils for vuepress",
"publishConfig": {
"access": "public"
@@ -21,8 +21,8 @@
"@babel/preset-env": "^7.0.0",
"@types/jest": "^23.3.10",
"@vue/test-utils": "^1.0.0-beta.16",
"@vuepress/core": "^1.0.0-alpha.36",
"@vuepress/shared-utils": "^1.0.0-alpha.36",
"@vuepress/core": "^1.0.0-alpha.37",
"@vuepress/shared-utils": "^1.0.0-alpha.37",
"babel-core": "^7.0.0-0",
"babel-jest": "^23.4.0",
"execa": "^0.10.0",
10 changes: 5 additions & 5 deletions packages/@vuepress/theme-blog/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@vuepress/theme-blog",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "theme-blog for vuepress",
"main": "index.js",
"publishConfig": {
@@ -19,10 +19,10 @@
"generator"
],
"dependencies": {
"@vuepress/plugin-blog": "^1.0.0-alpha.36",
"@vuepress/plugin-medium-zoom": "^1.0.0-alpha.36",
"@vuepress/plugin-pagination": "^1.0.0-alpha.36",
"@vuepress/plugin-search": "^1.0.0-alpha.36"
"@vuepress/plugin-blog": "^1.0.0-alpha.37",
"@vuepress/plugin-medium-zoom": "^1.0.0-alpha.37",
"@vuepress/plugin-pagination": "^1.0.0-alpha.37",
"@vuepress/plugin-search": "^1.0.0-alpha.37"
},
"author": "ULIVZ <chl814@foxmail.com>",
"license": "MIT",
4 changes: 4 additions & 0 deletions packages/@vuepress/theme-default/components/Sidebar.vue
Original file line number Diff line number Diff line change
@@ -41,6 +41,10 @@ export default {
padding 0.5rem 0 0.5rem 1.5rem
& > .sidebar-links
padding 1.5rem 0
& > li > a.sidebar-link
font-size 1.1em
line-height 1.7
font-weight bold
& > li:not(:first-child)
margin-top .75rem
Original file line number Diff line number Diff line change
@@ -97,7 +97,7 @@ export default {
border-left none
.sidebar-heading
color #999
color $textColor
transition color .15s ease
cursor pointer
font-size 1.1em
8 changes: 4 additions & 4 deletions packages/@vuepress/theme-default/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/theme-default",
"version": "1.0.0-alpha.36",
"version": "1.0.0-alpha.37",
"description": "Default theme for VuePress",
"main": "index.js",
"publishConfig": {
@@ -30,9 +30,9 @@
},
"homepage": "https://github.com/vuejs/vuepress/packages/@vuepress/theme-default#readme",
"dependencies": {
"@vuepress/plugin-active-header-links": "^1.0.0-alpha.36",
"@vuepress/plugin-nprogress": "^1.0.0-alpha.36",
"@vuepress/plugin-search": "^1.0.0-alpha.36",
"@vuepress/plugin-active-header-links": "^1.0.0-alpha.37",
"@vuepress/plugin-nprogress": "^1.0.0-alpha.37",
"@vuepress/plugin-search": "^1.0.0-alpha.37",
"docsearch.js": "^2.5.2",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2"
5 changes: 5 additions & 0 deletions packages/@vuepress/theme-default/util/index.js
Original file line number Diff line number Diff line change
@@ -222,6 +222,11 @@ function resolveItem (item, pages, base, groupDepth = 1) {
)
}
const children = item.children || []
if (children.length === 0) {
return Object.assign(resolvePage(pages, item.path, base), {
title: item.title
})
}
return {
type: 'group',
path: item.path,
Loading