Skip to content

Commit

Permalink
fix($shared-utils): use title variable for homepage (fix #2247) (#2307)
Browse files Browse the repository at this point in the history
  • Loading branch information
alizadeh118 committed May 28, 2020
1 parent 54b84b3 commit 869eb8d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/@vuepress/shared-utils/src/inferTitle.ts
Expand Up @@ -9,12 +9,12 @@ import deeplyParseHeaders from './deeplyParseHeaders'
*/

export = function (frontmatter: Record<string, any>, strippedContent: string): string | void {
if (frontmatter.home) {
return 'Home'
}
if (frontmatter.title) {
return deeplyParseHeaders(frontmatter.title)
}
if (frontmatter.home) {
return 'Home'
}
const match = strippedContent.trim().match(/^#+\s+(.*)/)
if (match) {
return deeplyParseHeaders(match[1])
Expand Down

0 comments on commit 869eb8d

Please sign in to comment.