Skip to content

Commit a559c7e

Browse files
authored
feat(web-react) improved webpage title generation logic (datahub-project#11773)
1 parent 7761394 commit a559c7e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

datahub-web-react/src/app/search/SearchablePage.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ export const SearchablePage = ({ onSearch, onAutoComplete, children }: Props) =>
7878
const formattedPath = location.pathname
7979
.split('/')
8080
.filter((word) => word !== '')
81-
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
81+
.map((rawWord) => {
82+
// ie. personal-notifications -> Personal Notifications
83+
const words = rawWord.split('-');
84+
return words.map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
85+
})
8286
.join(' | ');
8387

8488
if (formattedPath) {

0 commit comments

Comments
 (0)