Working on blog post

This commit is contained in:
2024-06-30 01:25:46 +02:00
parent ae224396fc
commit d94033a514
4 changed files with 34 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
<template>
<h2
:id="id"
>
<a
v-if="id && generate"
:href="`#${id}`"
class="font-semibold border-transparent border-b-2 hover:border-black dark:hover:border-white duration-300"
>
<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>

View File

@@ -0,0 +1,5 @@
<template>
<h3 class="text-base text-neutral-700 dark:text-neutral-300">
<slot />
</h3>
</template>

View File

@@ -0,0 +1,5 @@
<template>
<p class="text-neutral-700 dark:text-neutral-300">
<slot />
</p>
</template>

View File

@@ -24,7 +24,7 @@ useHead({
<main v-if="post">
<div class="flex">
<NuxtLink
class="flex items-center gap-2 mb-4 group text-sm hover:text-black dark:hover:text-white duration-300"
class="flex items-center gap-2 mb-8 group text-sm hover:text-black dark:hover:text-white duration-300"
to="/writings"
>
<UIcon