add: content-pages plugin

This commit is contained in:
Robert Janus 2025-05-21 13:26:51 +02:00
parent f5fa5b2971
commit 03c36844e5
5 changed files with 42 additions and 1 deletions

View file

@ -0,0 +1,19 @@
<script lang="ts" setup>
const slug = useRoute().params.slug
const { data: post } = await useAsyncData(`wissen-${slug}`, () => {
return queryCollection('wissen').path(`/wissen/${slug}`).first()
})
</script>
<template>
<template v-if="post">
<ContentRenderer :value="post" />
</template>
<template v-else>
<section class="Legal flex-col gap-default content full">
<h1>Page Not Found</h1>
<p>Oops! The content you're looking for doesn't exist.</p>
<NuxtLink to="/">Go back home</NuxtLink>
</section>
</template>
</template>