Sync completed + Navigation links improved

This commit is contained in:
2024-08-21 14:05:27 +02:00
parent a9a98b9618
commit 62ba72515b
17 changed files with 125 additions and 889 deletions

View File

@@ -1,6 +1,6 @@
<template>
<NuxtLink class="preview-link" v-if="data && data[0] && status !== 'pending'"
:to="{ path: `/explorer/${project}${data[0].path}`, hash: hash }" :class="class">
:to="{ path: `/explorer/${project}/${data[0].path}`, hash: hash }" :class="class">
<PreviewContent :project="project" :path="data[0].path" :anchor="hash">
<slot v-bind="$attrs"></slot>
<ThemeIcon class="link-icon" v-if="data && data[0] && data[0].type !== 'Markdown'" :height="20" :width="20"

View File

@@ -1,5 +1,23 @@
<template>
<blockquote>
<blockquote ref="el">
<slot />
</blockquote>
</template>
<script setup lang="ts">
const attrs = useAttrs(), el = ref<HTMLQuoteElement>(), title = ref<Element | null>(null);
onMounted(() => {
if(el && el.value && attrs.hasOwnProperty("dataCalloutFold"))
{
title.value = el.value.querySelector('.callout-title');
title.value?.addEventListener('click', toggle);
}
});
onUnmounted(() => {
title.value?.removeEventListener('click', toggle);
})
function toggle() {
el.value?.classList?.toggle('is-collapsed');
}
</script>

View File

@@ -6,6 +6,4 @@
<script setup lang="ts">
const props = defineProps<{ id?: string }>()
const generate = computed(() => props.id)
</script>