mirror of
https://github.com/ArthurDanjou/artsite.git
synced 2026-01-30 17:28:50 +01:00
Writing article
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user