Skip to content

Commit 2c092c2

Browse files
Various fixes
1 parent 6ba32f4 commit 2c092c2

2 files changed

Lines changed: 11 additions & 13 deletions

File tree

lib/prember-urls.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,24 @@ module.exports = function premberUrls({ distDir }) {
6161
let docsDir = path.join(distDir, 'docs');
6262

6363
if (fs.existsSync(docsDir)) {
64-
let files = fs.readdirSync(docsDir).filter((f) => f.endsWith('.json'));
64+
let files = fs
65+
.readdirSync(docsDir)
66+
.filter((f) => f.endsWith('.json'))
67+
.sort();
6568

66-
for (let file of files) {
69+
for (let i = 0; i < files.length; i++) {
6770
let docsJson = JSON.parse(
68-
fs.readFileSync(path.join(docsDir, file), 'utf8'),
71+
fs.readFileSync(path.join(docsDir, files[i]), 'utf8'),
6972
);
7073
let projectData = Array.isArray(docsJson.data)
7174
? docsJson.data[0]
7275
: docsJson.data;
7376
let navIndex = projectData?.attributes?.navigationIndex || [];
7477

75-
// Only generate /docs/api/ URLs for the first/main project.
76-
// Additional projects have their own route prefixes that
77-
// we can't determine automatically.
78-
if (files.length === 1 || file === files[0]) {
78+
// Only generate /docs/api/ URLs for the first (alphabetically)
79+
// project. Additional projects have their own route prefixes
80+
// that we can't determine automatically.
81+
if (files.length === 1 || i === 0) {
7982
urls.add('/docs');
8083

8184
for (let section of navIndex) {

tests/dummy/config/environment.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,7 @@ module.exports = function (environment) {
5454
ENV.fastboot = {
5555
// Restrict FastBoot host allowlist to known hosts instead of allowing all.
5656
// Add any additional production hostnames here, e.g. 'docs.example.com'.
57-
hostWhitelist: [
58-
'localhost',
59-
/^localhost:\d+$/,
60-
'127.0.0.1',
61-
'::1',
62-
],
57+
hostWhitelist: ['localhost', /^localhost:\d+$/, '127.0.0.1', '::1'],
6358
};
6459

6560
return ENV;

0 commit comments

Comments
 (0)