From 13529b9f7d47ea29ca8ea01c10fb4f7adc9a8cbe Mon Sep 17 00:00:00 2001 From: arthurfiorette Date: Sun, 25 Dec 2022 17:58:04 -0300 Subject: [PATCH] chore: docs versioning nav --- docs/.vitepress/config.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index ae4dbf32..50ff1af7 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -8,8 +8,10 @@ const VERSION = isVersion > -1 ? process.argv[isVersion + 1].slice(1, -1) : 'Lat const BASE_URL = isVersion > -1 ? process.argv[isVersion + 1] : '/'; console.log( - isVersion > -1 ? `Building docs for version ${VERSION}` : 'Building docs for latest version' -) + isVersion > -1 + ? `Building docs for version ${VERSION}` + : 'Building docs for latest version' +); export default defineConfig({ // The language of the site. This will be used to set the `lang` attribute on the element @@ -228,9 +230,12 @@ export default defineConfig({ { text: VERSION, items: [ + { text: 'Latest', link: 'https://axios-cache-interceptor.js.org/' }, { text: 'v1.x', link: 'https://axios-cache-interceptor.js.org/v1/' }, { text: 'v0.x', link: 'https://axios-cache-interceptor.js.org/v0/' } - ].filter((i) => !BASE_URL.startsWith(i.link)) + ].filter((i) => + BASE_URL === '/' ? i.text !== 'Latest' : !i.link.includes(BASE_URL) + ) } ],