Skip to content

Commit

Permalink
chore: docs versioning nav
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Dec 25, 2022
1 parent 9683de5 commit 13529b9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <html> element
Expand Down Expand Up @@ -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)
)
}
],

Expand Down

0 comments on commit 13529b9

Please sign in to comment.