mirror of
https://github.com/andwati/personal-website.git
synced 2026-10-28 15:22:17 +00:00
23 lines
398 B
Vue
23 lines
398 B
Vue
<script setup lang="ts">
|
|
const route = useRoute();
|
|
|
|
const { data: page } = await useAsyncData("page-" + route.path, () => {
|
|
return queryCollection("content").path(route.path).first();
|
|
});
|
|
|
|
if (!page.value) {
|
|
throw createError({
|
|
statusCode: 404,
|
|
statusMessage: "Page not found",
|
|
fatal: true,
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<ContentRenderer
|
|
v-if="page"
|
|
:value="page"
|
|
/>
|
|
</template>
|