Skip to content

Commit

Permalink
Use ContentBaseName() as fallback page Title
Browse files Browse the repository at this point in the history
Closes #7370
  • Loading branch information
rigtorp committed Oct 26, 2020
1 parent d48a98c commit 2e40022
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hugolib/page__meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ func (p *pageMeta) Sitemap() config.Sitemap {
}

func (p *pageMeta) Title() string {
if p.title == "" && !p.File().IsZero() {
return p.File().ContentBaseName()
}
return p.title
}

Expand Down

0 comments on commit 2e40022

Please sign in to comment.