Skip to content

Commit 8562a4f

Browse files
committed
fix($shared-utils): use title variable for homepage (fix vuejs#2247)
1 parent 16df156 commit 8562a4f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/@vuepress/shared-utils/src/inferTitle.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ import deeplyParseHeaders from './deeplyParseHeaders'
99
*/
1010

1111
export = function (frontmatter: Record<string, any>, strippedContent: string): string | void {
12-
if (frontmatter.home) {
13-
return 'Home'
14-
}
1512
if (frontmatter.title) {
1613
return deeplyParseHeaders(frontmatter.title)
14+
} else if (frontmatter.home) {
15+
return 'Home'
1716
}
1817
const match = strippedContent.trim().match(/^#+\s+(.*)/)
1918
if (match) {

0 commit comments

Comments
 (0)