Skip to content

Commit 069ffaa

Browse files
committed
Merge branch '7.x'
2 parents 6bc0291 + 8fb5ece commit 069ffaa

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/js/search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const root = 'https://mongoosejs.azurewebsites.net/api';
44

5-
const defaultVersion = '7.x';
5+
const defaultVersion = '8.x';
66
const versionFromUrl = window.location.pathname.match(/^\/docs\/(\d+\.x)/);
77
const version = versionFromUrl ? versionFromUrl[1] : defaultVersion;
88

scripts/generateSearch.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,11 @@ async function run() {
141141
}
142142
content.url = url;
143143
} else {
144-
const url = content.url.startsWith('/') ? content.url : `/${content.url}`;
145-
content.url = `/docs/${version}/docs${url}`;
144+
let url = content.url.startsWith('/') ? content.url : `/${content.url}`;
145+
if (!url.startsWith('/docs')) {
146+
url = '/docs' + url;
147+
}
148+
content.url = `/docs/${version}${url}`;
146149
}
147150
console.log(`${++count} / ${contents.length}`);
148151
await content.save();

0 commit comments

Comments
 (0)