Writing article

This commit is contained in:
2024-07-02 14:12:37 +02:00
parent c56ed8254f
commit 96f6c2fdda
10 changed files with 199 additions and 48 deletions

View File

@@ -1,5 +1,23 @@
<template>
<h3 class="text-base text-neutral-700 dark:text-neutral-300">
<slot />
</h3>
<h2
:id="id"
>
<a
v-if="id && generate"
:href="`#${id}`"
class="text-lg font-semibold text-neutral-800 dark:text-neutral-200"
>
<slot />
</a>
<slot v-else />
</h2>
</template>
<script lang="ts" setup>
import { computed, useRuntimeConfig } from '#imports'
const props = defineProps<{ id?: string }>()
const { headings } = useRuntimeConfig().public.mdc
const generate = computed(() => props.id && ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks) || (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h2)))
</script>