提交 69c85c59 编写于 作者: E Evan You

tweaks

上级 478ea333
......@@ -14,6 +14,7 @@ module.exports = {
themeConfig: {
logo: `/logo.png`,
repo: 'vuejs/vuepress',
editLinks: true,
docsDir: 'docs',
nav: [
{
......@@ -23,6 +24,10 @@ module.exports = {
{
text: 'Config Reference',
link: '/config/'
},
{
text: 'Default Theme Config',
link: '/default-theme-config/'
}
],
sidebar: {
......@@ -36,7 +41,6 @@ module.exports = {
'markdown',
'assets',
'using-vue',
'default-theme',
'custom-themes',
'deploy'
]
......
......@@ -20,7 +20,7 @@
### themeConfig
Also see [config options for the default theme](../guide/default-theme.md).
Also see [config options for the default theme](../default-theme-config/).
## Markdown
......
---
prev: ./using-vue
next: ./custom-themes
---
# Default Theme Configuration
# Default Theme Config
## Accent Color
......
---
prev: ./default-theme
prev: ./using-vue
next: ./deploy
---
......
......@@ -59,3 +59,13 @@ 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.
## Basic Configurations
### Title and Description
### Logo
### Navbar Links
### Sidebar
---
prev: ./assets
next: ./default-theme
next: ./custom-themes
---
# Using Vue in Markdown
......
<template>
<div class="theme-container"
:class="{
'no-navbar': !shouldShowNavbar,
'sidebar-open': isSidebarOpen,
'no-sidebar': $page.frontmatter.home || $page.frontmatter.sidebar === false
'no-sidebar': !shouldShowSidebar
}"
@touchstart="onTouchStart"
@touchend="onTouchEnd">
<Navbar @toggle-sidebar="toggleSidebar"/>
<Navbar v-if="shouldShowNavbar" @toggle-sidebar="toggleSidebar"/>
<Sidebar @toggle-sidebar="toggleSidebar"/>
<div class="custom-layout" v-if="$page.frontmatter.layout">
<component :is="$page.frontmatter.layout"/>
......@@ -33,6 +34,27 @@ export default {
}
},
computed: {
shouldShowNavbar () {
const { themeConfig } = this.$site
return (
this.$site.title ||
themeConfig.logo ||
themeConfig.repo ||
themeConfig.nav
)
},
shouldShowSidebar () {
const { themeConfig } = this.$site
const { frontmatter } = this.$page
return (
themeConfig.sidebar &&
!frontmatter.home &&
frontmatter.sidebar !== false
)
}
},
created () {
if (this.$ssrContext) {
this.$ssrContext.title = getTitle(this.$site, this.$page)
......
......@@ -57,9 +57,8 @@ export default {
@media (min-width: $MQMobile)
.nav-links a
&:hover:not(.router-link-active)
color $textColor
&:hover, &.router-link-active
color $textColor
margin-bottom -2px
border-bottom 2px solid lighten($accentColor, 10%)
border-bottom 2px solid lighten($accentColor, 5%)
</style>
......@@ -48,6 +48,7 @@ export default {
position relative
top -0.125rem
.links
font-size 0.95rem
float right
a:not(:last-child)
margin-right 1.5rem
......
......@@ -45,13 +45,18 @@ export default {
docsBranch = 'master'
} = this.$site.themeConfig
const path = normalize(this.$page.path) + '.md'
let path = normalize(this.$page.path)
if (endingSlashRE.test(path)) {
path += 'README.md'
} else {
path += '.md'
}
if (repo && editLinks !== false) {
if (repo && editLinks) {
const base = outboundRE.test(repo)
? repo
: `https://github.com/${repo}`
return base.replace(endingSlashRE, '') + `/edit/${docsBranch}/${docsDir}${path}`
return `${base}/edit/${docsBranch}/${docsDir}${path}`.replace(/\/+/g, '/')
}
}
}
......@@ -63,7 +68,6 @@ export default {
.edit-link
padding-top 0 !important
padding-bottom 0 !important
a
color lighten($textColor, 25%)
margin-right 0.25rem
......@@ -71,6 +75,7 @@ export default {
.page-nav.content
min-height 2.2rem
padding-bottom 2rem
padding-top 0.5rem !important
.inner
margin-top 0 !important
border-top 1px solid $borderColor
......
......@@ -52,6 +52,12 @@ body
margin-top $navbarHeight
a:hover
text-decoration underline
p.demo
padding 1rem 1.5rem
border 1px solid #ddd
border-radius 4px
img
max-width $contentWidth
.content.custom
padding 0
......@@ -119,12 +125,6 @@ code
p, ul, ol
line-height 1.7
p
&.demo
padding 1rem 1.5rem
border 1px solid #ddd
border-radius 4px
table
border-collapse collapse
margin 1rem 0
......@@ -141,9 +141,17 @@ th, td
.custom-layout
padding-top $navbarHeight
.theme-container.no-navbar
.content:not(.custom)
h1, h2, h3, h4, h5, h6
margin-top 1.5rem
padding-top 0
@media (min-width: ($MQMobile + 1px))
.theme-container.no-sidebar
.sidebar
display none
.page
padding-left 0
@import './mobile.stylus'
......@@ -12,7 +12,7 @@ module.exports = md => {
const link = token.attrs[hrefIndex]
const href = link[1]
const isExternal = /^https?:/.test(href)
const isSourceLink = href === '/' || /\.(md|html)(#[\w-]*)?$/.test(href)
const isSourceLink = /(\/|\.md|\.html)(#[\w-]*)?$/.test(href)
if (isExternal) {
const targetIndex = token.attrIndex('target')
if (targetIndex < 0) {
......
# Hello VuePress!
# Hello Simple
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册