Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions docs/.vitepress/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ export const navbar: DefaultTheme.NavItem[] = [
text: IS_NEXT ? PROJECT_VARS.VERSION_SNAPSHOT : PROJECT_VARS.VERSION,
items: [
// Absolute, since each channel is a site of its own, with its own base.
IS_NEXT
? { text: `Latest release (${PROJECT_VARS.VERSION})`, link: SITE_URL }
: { text: 'Unreleased (main)', link: new URL(NEXT_BASE, SITE_URL).href },
// VitePress opens absolute links in a new tab; the other channel is
// the same site to the reader, so it opens in place.
{
...(IS_NEXT
? { text: `Latest release (${PROJECT_VARS.VERSION})`, link: SITE_URL }
: { text: 'Unreleased (main)', link: new URL(NEXT_BASE, SITE_URL).href }),
target: '_self',
noIcon: true,
},
{
text: 'Changelog',
link: 'https://github.com/devopvoid/webrtc-java/blob/main/CHANGELOG.md'
Expand Down
4 changes: 3 additions & 1 deletion docs/.vitepress/theme/NextBanner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ const isNext = computed(() => site.value.base === NEXT_BASE)
</script>

<template>
<!-- target="_self" keeps the router of this site from handling the link, as
the root is another site. -->
<div v-if="isNext" class="next-banner">
These docs describe the unreleased development version {{ PROJECT_VARS.VERSION_SNAPSHOT }}.
See the docs of the <a :href="SITE_URL">latest release, {{ PROJECT_VARS.VERSION }}</a>.
See the docs of the <a :href="SITE_URL" target="_self">latest release, {{ PROJECT_VARS.VERSION }}</a>.
</div>
</template>

Expand Down
Loading