From d19393158dd67b01069499f2626331d1b7923d68 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Sat, 21 Apr 2018 00:24:31 +0800 Subject: [PATCH 1/2] fix: prioritize frontmatter's title and lang (close: #177) --- lib/app/dataMixin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/app/dataMixin.js b/lib/app/dataMixin.js index 084dd4c2ad..51ef6fae08 100644 --- a/lib/app/dataMixin.js +++ b/lib/app/dataMixin.js @@ -47,13 +47,13 @@ export default { return targetLang || defaultLang || {} }, $title () { - return this.$localeConfig.title || this.$site.title || '' + return this.$page.frontmatter.title || this.$localeConfig.title || this.$site.title || '' }, $description () { - return this.$localeConfig.description || this.$site.description || '' + return this.$page.frontmatter.title || this.$localeConfig.description || this.$site.description || '' }, $lang () { - return this.$localeConfig.lang || 'en-US' + return this.$page.frontmatter.lang || this.$localeConfig.lang || 'en-US' }, $localePath () { return this.$localeConfig.path || '/' From 89b8386c43cd2b3710d08c3e9874463e76c75378 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Sat, 21 Apr 2018 00:39:15 +0800 Subject: [PATCH 2/2] chore: fix typo --- lib/app/dataMixin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app/dataMixin.js b/lib/app/dataMixin.js index 51ef6fae08..2f3abab6b9 100644 --- a/lib/app/dataMixin.js +++ b/lib/app/dataMixin.js @@ -50,7 +50,7 @@ export default { return this.$page.frontmatter.title || this.$localeConfig.title || this.$site.title || '' }, $description () { - return this.$page.frontmatter.title || this.$localeConfig.description || this.$site.description || '' + return this.$page.frontmatter.description || this.$localeConfig.description || this.$site.description || '' }, $lang () { return this.$page.frontmatter.lang || this.$localeConfig.lang || 'en-US'