docs: fix archive links (#9987)

This commit is contained in:
Alex Rudenko 2023-04-06 14:30:10 +02:00 committed by GitHub
parent 75a136e0de
commit 19852497a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -280,9 +280,18 @@ const config = {
value: '<b>Archived versions</b>',
},
...archivedVersions.map(version => {
const parts = version.split('.').map(item => {
return Number(item);
});
if (parts[0] <= 19 && parts[1] <= 2 && parts[2] <= 2) {
return {
label: version,
href: `https://github.com/puppeteer/puppeteer/blob/v${version}/docs/api/index.md`,
};
}
return {
label: version,
href: `https://github.com/puppeteer/puppeteer/blob/v${version}/docs/api/index.md`,
href: `https://github.com/puppeteer/puppeteer/blob/puppeteer-v${version}/docs/api/index.md`,
};
}),
],