Skip to content

useTags

You can import the useTags() composable from @lando/vitepress-theme-default-plus and use it to create a docs version index page or to show other taggy things.

js
const {
  // alias:ref pairs
  aliases,
  // alias:link pairs
  aliasLinks,
  // extended version information
  extended,
  // versions prepared for injection into `VPLVersionLink`
  links,
  // a list of all matched and satisfied versions
  versions,
} = useTeam();

Note that aliasLinks and links will only be available if you've configured Multiversion Build.

Here is how we generate our version index page at /v/.

md
# Docuverse

<br />
<br />

<div
  v-for="link in links"
  :key="link.text"
  class="version-link"
>
  <VPLVersionLink
    :text="link.text"
    :href="link.href"
    :prerelease="link.prerelease"
    :stable="link.stable"
    :edge="link.edge"
  />
</div>

<br />

<div>
  <VPLVersionLink :dev="true" :text="aliases.dev" :href="aliasLinks.dev" />
</div>

<script setup>
import {useTags} from '@lando/vitepress-theme-default-plus';
import {VPLCollectionPage, VPLCollectionPageSection, VPLCollectionPageTitle, VPLVersionLink} from '@lando/vitepress-theme-default-plus';

const {aliases, aliasLinks, links} = useTags();
</script>