mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-26 17:37:33 +00:00
feat(web-react) improved webpage title generation logic (#11773)
This commit is contained in:
parent
7761394d68
commit
a559c7ee5f
@ -78,7 +78,11 @@ export const SearchablePage = ({ onSearch, onAutoComplete, children }: Props) =>
|
||||
const formattedPath = location.pathname
|
||||
.split('/')
|
||||
.filter((word) => word !== '')
|
||||
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
||||
.map((rawWord) => {
|
||||
// ie. personal-notifications -> Personal Notifications
|
||||
const words = rawWord.split('-');
|
||||
return words.map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
|
||||
})
|
||||
.join(' | ');
|
||||
|
||||
if (formattedPath) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user