Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/app/components/content/ProseA.vue
blob: 3fe1f24e74c3c108c692f30df0276db6a410ebf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<!-- SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -->
<!-- SPDX-License-Identifier: AGPL-3.0-or-later WITH AdditionRef-Progmasoft-Patent-Grant-1.1 -->

<!-- A link of a document: a page of the site keeps the language of the reader. -->
<script setup lang="ts">
const props = defineProps<{ href?: string; target?: string }>();
const { to } = useSiteLocale();
const local = computed(() => props.href?.startsWith("/") ?? false);
</script>

<template>
  <NuxtLink v-if="local" :to="to(href!)"><slot /></NuxtLink>
  <a v-else :href="href" :target="target"><slot /></a>
</template>