File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ const { readdirSync, readFileSync } = require('fs');
2
2
const cmp = require ( 'semver-compare' ) ;
3
3
const semver = require ( 'semver' ) ;
4
4
5
+ function partialUrlEncode ( input ) {
6
+ return input . replace ( '/' , '%2F' ) ;
7
+ }
8
+
5
9
module . exports = function ( ) {
6
10
const projects = readdirSync ( 'ember-api-docs-data/json-docs' ) ;
7
11
@@ -67,9 +71,19 @@ module.exports = function () {
67
71
urls . push ( `/${ p } /${ uniqVersion } /${ entity } /${ cleanId } ` ) ;
68
72
69
73
// TODO only include sub routes if that entity has stuff in that route i.e. if it's empty don't pre-render it
70
- urls . push ( `/${ p } /${ uniqVersion } /${ entity } /${ cleanId } /methods` ) ;
71
- urls . push ( `/${ p } /${ uniqVersion } /${ entity } /${ cleanId } /properties` ) ;
72
- urls . push ( `/${ p } /${ uniqVersion } /${ entity } /${ cleanId } /events` ) ;
74
+ urls . push (
75
+ `/${ p } /${ uniqVersion } /${ entity } /${ partialUrlEncode (
76
+ cleanId
77
+ ) } /methods`
78
+ ) ;
79
+ urls . push (
80
+ `/${ p } /${ uniqVersion } /${ entity } /${ partialUrlEncode (
81
+ cleanId
82
+ ) } /properties`
83
+ ) ;
84
+ urls . push (
85
+ `/${ p } /${ uniqVersion } /${ entity } /${ partialUrlEncode ( cleanId ) } /events`
86
+ ) ;
73
87
74
88
if ( entity === 'modules' ) {
75
89
// id is
@@ -93,9 +107,8 @@ module.exports = function () {
93
107
94
108
listOfFunctions . forEach ( ( func ) => {
95
109
urls . push (
96
- `/${ p } /${ uniqVersion } /functions/${ cleanId . replace (
97
- '/' ,
98
- '%2F'
110
+ `/${ p } /${ uniqVersion } /functions/${ partialUrlEncode (
111
+ cleanId
99
112
) } /${ func . name } `
100
113
) ;
101
114
} ) ;
You can’t perform that action at this time.
0 commit comments