mirror of
https://github.com/andwati/personal-website.git
synced 2026-11-19 01:05:15 +00:00
switch to nuxt
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user