feat: Routes de l'arborescence
All checks were successful
Deploy WordPress and Nuxt / deploy (push) Successful in 57s

This commit is contained in:
2025-09-15 14:38:14 -04:00
parent 0f00615f35
commit 4c3f0a26bf
14 changed files with 132 additions and 2 deletions

View File

@@ -5,5 +5,23 @@ query nodeByUri($uri: String!) {
... on Page {
...ThePage
}
... on Post {
...TheArticle
}
... on Event {
...TheEvent
}
... on Location {
...TheLocation
}
... on Membership {
...TheMembership
}
... on Project {
...TheProject
}
... on Resource {
...TheResource
}
}
}

View File

@@ -1,5 +1,21 @@
import type { ThePageFragment } from "#graphql-operations";
import { ThePage } from "#components";
import type {
ThePageFragment,
TheArticleFragment,
TheEventFragment,
TheLocationFragment,
TheMembershipFragment,
TheProjectFragment,
TheResourceFragment,
} from "#graphql-operations";
import {
ThePage,
TheArticle,
TheEvent,
TheLocation,
TheMembership,
TheProject,
TheResource,
} from "#components";
export async function useNodeByUri() {
const route = useRoute();
@@ -12,6 +28,18 @@ export async function useNodeByUri() {
switch (node?.__typename) {
case "Page":
return { component: ThePage, node: node as ThePageFragment };
case "Post":
return { component: TheArticle, node: node as TheArticleFragment };
case "Event":
return { component: TheEvent, node: node as TheEventFragment };
case "Location":
return { component: TheLocation, node: node as TheLocationFragment };
case "Membership":
return { component: TheMembership, node: node as TheMembershipFragment };
case "Project":
return { component: TheProject, node: node as TheProjectFragment };
case "Resource":
return { component: TheResource, node: node as TheResourceFragment };
default:
throw createError({ statusCode: 404, message: "Page non trouvée", fatal: true });
}