Skip to content

Commit

Permalink
Add description to metaTitle when no selfTitle
Browse files Browse the repository at this point in the history
  • Loading branch information
f-w committed Feb 5, 2021
1 parent cd4ad04 commit d03d6f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/@vuepress/core/lib/node/ClientComputedMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ module.exports = siteData => {
page.frontmatter.title // explicit title
|| page.title // inferred title
)
const description = this.$description.trim()
const siteTitleAndDescription = description.length > 0 ? siteTitle + ' | ' + description : siteTitle
return siteTitle
? selfTitle
? (selfTitle + ' | ' + siteTitle)
: siteTitle
: siteTitleAndDescription
: selfTitle || 'VuePress'
}

Expand Down

0 comments on commit d03d6f0

Please sign in to comment.