File tree 9 files changed +41
-11
lines changed
9 files changed +41
-11
lines changed Original file line number Diff line number Diff line change
1
+ nodejs 18.17.1
Original file line number Diff line number Diff line change @@ -11,8 +11,9 @@ export default class ApplicationRoute extends Route {
11
11
@service
12
12
legacyModuleMappings ;
13
13
14
- title ( tokens ) {
15
- let [ version , entity ] = tokens ;
14
+ title ( ) {
15
+ let entity = this . headData . modelName ;
16
+ let version = this . headData . modelVersion ;
16
17
if ( ! entity ) {
17
18
entity = 'Ember' ;
18
19
}
@@ -30,6 +31,22 @@ export default class ApplicationRoute extends Route {
30
31
async afterModel ( ) {
31
32
set ( this , 'headData.cdnDomain' , ENV . API_HOST ) ;
32
33
await this . legacyModuleMappings . initMappings ( ) ;
34
+
35
+ let entity = this . headData . modelName ;
36
+ let version = this . headData . modelVersion ;
37
+ if ( ! entity ) {
38
+ entity = 'Ember' ;
39
+ }
40
+ if ( version ) {
41
+ const compactVersion = getCompactVersion ( version ) ;
42
+ const title = `${ [ entity , compactVersion ] . join (
43
+ ' - '
44
+ ) } - Ember API Documentation`;
45
+ set ( this , 'headData.title' , title ) ;
46
+ return title ;
47
+ }
48
+ return '' ;
49
+
33
50
return super . afterModel ( ...arguments ) ;
34
51
}
35
52
}
Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ export default class ProjectVersionRoute extends Route {
43
43
} ) ;
44
44
}
45
45
46
+ afterModel ( model ) {
47
+ this . headData . modelVersion = model . version ;
48
+ }
49
+
46
50
// Using redirect instead of afterModel so transition succeeds and returns 307
47
51
redirect ( model , transition ) {
48
52
const lookupParams = ( routeName ) => {
Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ export default class ClassRoute extends Route.extend(ScrollTracker) {
36
36
return this . find ( 'class' , `${ project } -${ projectVersion } -${ klass } ` ) ;
37
37
}
38
38
39
+ afterModel ( model ) {
40
+ this . headData . modelName = model . name ;
41
+ }
42
+
39
43
find ( typeName , param ) {
40
44
return this . store . find ( typeName , param ) . catch ( ( e1 ) => {
41
45
if ( typeName != 'namespace' ) {
Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ export default class FunctionRoute extends Route {
56
56
if ( description ) {
57
57
set ( this , 'headData.description' , createExcerpt ( description ) ) ;
58
58
}
59
+
60
+ this . headData . functionName = model ?. fn ?. name ;
59
61
}
60
62
61
63
getFunctionObjFromList ( classObj , functionName ) {
Original file line number Diff line number Diff line change @@ -9,4 +9,6 @@ export default class HeadDataService extends Service {
9
9
@tracked canonicalUrl ;
10
10
@tracked description ;
11
11
@tracked cdnDomain ;
12
+ @tracked modelName ;
13
+ @tracked modelVersion ;
12
14
}
Original file line number Diff line number Diff line change 3
3
<SearchInput />
4
4
</EsNavbar >
5
5
</EsHeader >
6
- <main class =" container" >
6
+ <main class =' container' >
7
7
{{ outlet }}
8
8
</main >
9
9
<EsFooter />
10
10
11
- {{!-- required by ember-cli-meta-tags -- }}
12
- <HeadLayout />
11
+ {{! required by ember-cli-meta-tags }}
12
+ <HeadLayout />
Original file line number Diff line number Diff line change 1
1
<title >{{ this.model.title }} </title >
2
2
3
- <link rel =" dns-prefetch" href =" {{ this.model.cdnDomain }} " >
4
- <meta property =" og:title" content ={{ this.model.title }} >
3
+ <link rel =' dns-prefetch' href =' {{ this.model.cdnDomain }} ' / >
4
+ <meta property =' og:title' content ={{ this.model.title }} / >
5
5
6
6
{{ #if this.model.description }}
7
- <meta name =" description" content ={{ this.model.description }} >
8
- <meta property =" og:description" content ={{ this.model.description }} >
7
+ <meta name =' description' content ={{ this.model.description }} / >
8
+ <meta property =' og:description' content ={{ this.model.description }} / >
9
9
{{ /if }}
10
10
{{ #unless this.model.isRelease }}
11
- <link rel =" canonical" href ={{ this.model.canonicalUrl }} >
11
+ <link rel =' canonical' href ={{ this.model.canonicalUrl }} / >
12
12
{{ /unless }}
Original file line number Diff line number Diff line change 78
78
"ember-cli-deploy-gzip" : " ^1.0.0" ,
79
79
"ember-cli-deprecation-workflow" : " ^2.1.0" ,
80
80
"ember-cli-fastboot" : " ^4.1.5" ,
81
+ "ember-cli-head" : " ^2.0.0" ,
81
82
"ember-cli-htmlbars" : " ^6.1.1" ,
82
83
"ember-cli-inject-live-reload" : " ^2.1.0" ,
83
- "ember-cli-meta-tags" : " ^7.0.0" ,
84
84
"ember-cli-sass" : " ^10.0.1" ,
85
85
"ember-cli-showdown" : " ^9.0.1" ,
86
86
"ember-cli-terser" : " ^4.0.2" ,
You can’t perform that action at this time.
0 commit comments