Skip to content

Commit

Permalink
fix: siteTitle vs pageTitle
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 23, 2018
1 parent 52c20cf commit cd9b788
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion lib/app/dataMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ export default {
}
return targetLang || defaultLang || {}
},
$siteTitle () {
return this.$localeConfig.title || this.$site.title || ''
},
$title () {
const page = this.$page
const siteTitle = this.$localeConfig.title || this.$site.title || ''
const siteTitle = this.$siteTitle
const selfTitle = page.frontmatter.home ? null : (
page.frontmatter.title || // explicit title
page.title // inferred title
Expand Down
4 changes: 2 additions & 2 deletions lib/default-theme/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
v-if="$site.themeConfig.logo"
:src="$withBase($site.themeConfig.logo)">
<span class="site-name"
v-if="$title"
v-if="$siteTitle"
:class="{ 'can-hide': $site.themeConfig.logo }">
{{ $title }}
{{ $siteTitle }}
</span>
</router-link>
<div class="links">
Expand Down

0 comments on commit cd9b788

Please sign in to comment.