From db88a556526395715f891d5553044326e01b70fb Mon Sep 17 00:00:00 2001 From: Zerook Date: Tue, 20 Nov 2018 01:34:51 +0800 Subject: [PATCH] fix #906 : Blog plugin blocking front matter custom layout config - cp attrs from default to raw frontmatters, if not exists --- packages/@vuepress/plugin-blog/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/@vuepress/plugin-blog/index.js b/packages/@vuepress/plugin-blog/index.js index 00a4d870f2..ae8d794319 100644 --- a/packages/@vuepress/plugin-blog/index.js +++ b/packages/@vuepress/plugin-blog/index.js @@ -64,7 +64,9 @@ module.exports = (options, ctx) => { frontmatter = {} }) => { if (when(pageCtx)) { - Object.assign(rawFrontmatter, frontmatter) + Object.keys(frontmatter).forEach(key => { + rawFrontmatter[key] = rawFrontmatter[key] || frontmatter[key] + }) Object.assign(pageCtx, data) } })