File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -12,17 +12,7 @@ import DocSearch from "./components/DocSearch";
1212const config : DocsThemeConfig = {
1313 head : function Head ( ) {
1414 const router = useRouter ( )
15- const { frontMatter } = useConfig ( )
16-
17- let pageTitle = frontMatter ?. title ;
18- // If no title in front matter, derive it from the URL
19- if ( ! pageTitle ) {
20- const segments = router . asPath . replace ( / \/ $ / , "" ) . split ( "/" ) ;
21- pageTitle = segments [ segments . length - 1 ] ;
22- // Replace dashes/underscores with spaces and capitalize each first letter
23- pageTitle = pageTitle . replace ( / [ - _ ] / g, " " ) ;
24- pageTitle = pageTitle . replace ( / \b \w / g, ( char ) => char . toUpperCase ( ) ) ;
25- }
15+ const { title } = useConfig ( )
2616
2717 return (
2818 < >
@@ -31,7 +21,7 @@ const config: DocsThemeConfig = {
3121 ? ""
3222 : router . route } `} /> }
3323 < link rel = "icon" href = "/docs/favicon.ico" />
34- < meta property = "og:title" content = { `${ pageTitle } — Pipedream` } />
24+ < meta property = "og:title" content = { `${ title } — Pipedream` } />
3525 </ >
3626 )
3727 } ,
You can’t perform that action at this time.
0 commit comments