mirror of
https://github.com/jaronpate/folio.git
synced 2026-10-19 01:07:39 +00:00
feat: added nuxt content
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<script lang="ts" setup>
|
||||
const route = useRoute();
|
||||
const { data: page } = await useAsyncData(route.path, () => {
|
||||
return queryCollection('writing').path(route.path).first();
|
||||
});
|
||||
|
||||
if (!page.value) {
|
||||
throw createError({ statusCode: 404, statusMessage: 'Page Not Found' });
|
||||
}
|
||||
|
||||
useSeoMeta({
|
||||
title: page.value?.title,
|
||||
description: page.value?.description,
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<ContentRenderer v-if="page" :value="page" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
const { data: home } = await useAsyncData(() =>
|
||||
queryCollection('writing').path('/writing').first(),
|
||||
);
|
||||
|
||||
useSeoMeta({
|
||||
title: home.value?.title,
|
||||
description: home.value?.description,
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ContentRenderer v-if="home" :value="home" />
|
||||
<div v-else>Home not found</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user