File tree 3 files changed +25
-6
lines changed
3 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -28,15 +28,31 @@ const DocumentPage = {
28
28
this . updateTitle ( ) ;
29
29
}
30
30
} ,
31
- create : function ( ) {
31
+ mounted ( ) {
32
32
this . updateTitle ( ) ;
33
33
} ,
34
34
methods : {
35
- updateTitle : function ( ) {
36
- const link = this . $t ( "links" ) . find ( link => link . url === this . document ) ;
37
- if ( link ) {
38
- window . document . title = link . name + " | TypeORM" ;
35
+ getCurrentDocumentName ( links = Links ) {
36
+ for ( const link of links ) {
37
+ if ( link . url === this . document )
38
+ return link . name ;
39
+ else if ( link . links instanceof Array ) {
40
+ const res = this . getCurrentDocumentName ( link . links ) ;
41
+ if ( res != null )
42
+ return res ;
43
+ }
39
44
}
45
+
46
+ return null ;
47
+ } ,
48
+ updateTitle : function ( ) {
49
+ const documentName = this . getCurrentDocumentName ( ) ;
50
+ if ( ! this . document )
51
+ document . title = this . $t ( "title" ) ;
52
+ else if ( documentName )
53
+ window . document . title = documentName + " | TypeORM" ;
54
+ else
55
+ document . title = this . $t ( "title" ) ;
40
56
}
41
57
} ,
42
58
components : {
Original file line number Diff line number Diff line change @@ -41,6 +41,5 @@ new Vue({
41
41
} ,
42
42
mounted : function ( ) {
43
43
i18n . locale = $cookies . get ( "locale" ) || "en" ;
44
- document . title = this . $t ( "title" ) ;
45
44
}
46
45
} ) ;
Original file line number Diff line number Diff line change @@ -297,6 +297,10 @@ img {
297
297
height : auto;
298
298
}
299
299
300
+ .DocSearch mark {
301
+ padding : initial;
302
+ }
303
+
300
304
@media (prefers-color-scheme : dark) {
301
305
body {
302
306
background-color : # 18191a ;
You can’t perform that action at this time.
0 commit comments