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');
22const cmp = require ( 'semver-compare' ) ;
33const semver = require ( 'semver' ) ;
44
5+ function partialUrlEncode ( input ) {
6+ return input . replace ( '/' , '%2F' ) ;
7+ }
8+
59module . exports = function ( ) {
610 const projects = readdirSync ( 'ember-api-docs-data/json-docs' ) ;
711
@@ -67,9 +71,19 @@ module.exports = function () {
6771 urls . push ( `/${ p } /${ uniqVersion } /${ entity } /${ cleanId } ` ) ;
6872
6973 // 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+ ) ;
7387
7488 if ( entity === 'modules' ) {
7589 // id is
@@ -93,9 +107,8 @@ module.exports = function () {
93107
94108 listOfFunctions . forEach ( ( func ) => {
95109 urls . push (
96- `/${ p } /${ uniqVersion } /functions/${ cleanId . replace (
97- '/' ,
98- '%2F'
110+ `/${ p } /${ uniqVersion } /functions/${ partialUrlEncode (
111+ cleanId
99112 ) } /${ func . name } `
100113 ) ;
101114 } ) ;
You can’t perform that action at this time.
0 commit comments