<commit_before><template>
  <router-link :to="finalTo">
    <slot></slot>
  </router-link>
</template>

<script>
  export default {
    props: ['to'],
    computed: {
      finalTo() {
        let tempTo = this.to.startsWith('/')
          ? this.to.slice(1)
          : this.to;

        return `${this.$site.themeConfig.activeVersion.link}${tempTo}`;
      }
    },
  }
</script><commit_msg>Improve docs-link component for docs versions<commit_after><template>
  <router-link :to="finalTo">
    <slot></slot>
  </router-link>
</template>

<script>
  export default {
    props: ['to'],
    computed: {
      finalTo() {
        const currentPageVersion = this.getCurrentPageVersion();
        const activeVersion = this.$site.themeConfig.activeVersion.link;
        const tempTo = this.to.startsWith('/')
          ? this.to.slice(1)
          : this.to;
        const versionLink = activeVersion == currentPageVersion
          ? this.$site.themeConfig.activeVersion.link
          : `/docs/${currentPageVersion}/`;

        return `${versionLink}${tempTo}`;
      }
    },
    methods: {
      getCurrentPageVersion() {
        return this.$page.path.match(/([0-9]*[.])?[0-9]+/)[0];
      }
    },
  }
</script>
{'fraction_non_alphanumeric': 0.1728395061728395, 'fraction_numerical': 0.005761316872427984, 'mean_word_length': 2.3871866295264623, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '115336', 'n_tokens_mistral': 390, 'n_tokens_neox': 395, 'n_words': 62}