diff --git a/components/EditGitLab.vue b/components/EditGitLab.vue new file mode 100644 index 0000000000000000000000000000000000000000..50fda769789fcdf2f9b9f11114f24ae3b3bc1a74 --- /dev/null +++ b/components/EditGitLab.vue @@ -0,0 +1,22 @@ +<template> + <ProseA :to="path" target="blank"> + <span> Edit this page on GitLab </span> + </ProseA> +</template> +<script setup lang="ts"> +import { ref } from "vue"; +const { page } = useContent(); +const config = useDocus(); +const props = defineProps<{ + owner: string; + repo: string; + branch: string; +}>(); +const baseUrl = ref(new URL("https://gitlab.pasteur.fr")); +const path = ref( + new URL( + `/${props.owner}/${props.repo}/-/edit/${props.branch}/content/${page.value._file}`, + baseUrl.value + ).href +); +</script>