feat: Initial NodeByUri logic and frontend

This commit is contained in:
2026-01-13 21:25:20 -05:00
parent 5bda835566
commit 688c4e36b3
10 changed files with 291 additions and 1 deletions

View File

@@ -1,6 +1,19 @@
<script setup lang="ts">
const { path: uri } = useRoute();
const { data } = await useGraphQLQuery("NodeByUri", { uri });
// Resolve and validate Node component
if (!data.value.nodeByUri) {
throw createError({ statusCode: 404, message: `La page demandée est introuvable: ${uri}` });
}
const componentName = `Node${data.value.nodeByUri.__typename}`;
if (!useNuxtApp().vueApp.component(componentName)) {
throw createError({ statusCode: 404, message: `La page demandée ne peut pas être affichée correctement: ${componentName}` });
}
</script>
<template>
<div id="page-node-from-uri" />
<div v-if="data.nodeByUri" id="page-node-from-uri">
<Component :is="componentName" v-bind="data.nodeByUri" />
</div>
</template>