Skip to content

Commit 2961060

Browse files
committed
Merge branch 'master' of github.com:vuejs/vuepress into explode-md-includes
2 parents 180caff + a51a31b commit 2961060

File tree

4 files changed

+521
-546
lines changed

4 files changed

+521
-546
lines changed

lib/default-theme/Layout.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ export default {
150150
(scrollTop >= anchor.parentElement.offsetTop + 10 &&
151151
(!nextAnchor || scrollTop < nextAnchor.parentElement.offsetTop - 10))
152152
153-
if (isActive && this.$route.hash !== anchor.hash) {
153+
if (isActive && decodeURIComponent(this.$route.hash) !== decodeURIComponent(anchor.hash)) {
154154
store.disableScrollBehavior = true
155-
this.$router.replace(anchor.hash, () => {
155+
this.$router.replace(decodeURIComponent(anchor.hash), () => {
156156
// execute after scrollBehavior handler.
157157
this.$nextTick(() => {
158158
store.disableScrollBehavior = false

lib/prepare.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ async function resolveOptions (sourceDir) {
230230
data.frontmatter = frontmatter.data
231231
}
232232
if (frontmatter.excerpt) {
233-
data.excerpt = frontmatter.excerpt
233+
const { html } = markdown.render(frontmatter.excerpt)
234+
data.excerpt = html
234235
}
235236
return data
236237
}))

lib/webpack/createBaseConfig.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ module.exports = function createBaseConfig ({
9595
if (filepath.startsWith(libDir)) {
9696
return false
9797
}
98-
// always trasnpile js in vue files
98+
// always transpile js in vue files
9999
if (/\.vue\.js$/.test(filepath)) {
100100
return false
101101
}
@@ -197,7 +197,8 @@ module.exports = function createBaseConfig ({
197197
.options({
198198
modules,
199199
localIdentName: `[local]_[hash:base64:8]`,
200-
importLoaders: 1
200+
importLoaders: 1,
201+
sourceMap: !isProd
201202
})
202203

203204
rule.use('postcss-loader').loader('postcss-loader').options(Object.assign({
@@ -212,6 +213,7 @@ module.exports = function createBaseConfig ({
212213
}
213214

214215
createCSSRule('css', /\.css$/)
216+
createCSSRule('postcss', /\.p(ost)?css$/)
215217
createCSSRule('scss', /\.scss$/, 'sass-loader', siteConfig.scss)
216218
createCSSRule('sass', /\.sass$/, 'sass-loader', Object.assign({ indentedSyntax: true }, siteConfig.sass))
217219
createCSSRule('less', /\.less$/, 'less-loader', siteConfig.less)

0 commit comments

Comments
 (0)