From 19852497a2ef786c7a6e16b60f29d0a278c64c02 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Thu, 6 Apr 2023 14:30:10 +0200 Subject: [PATCH] docs: fix archive links (#9987) --- website/docusaurus.config.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 31bd8a2d..64dbee8d 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -280,9 +280,18 @@ const config = { value: 'Archived versions', }, ...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`, }; }), ],