From badaecc49d2d51a0ef2c80269b4000dc0a1312ca Mon Sep 17 00:00:00 2001 From: Nico Schett <52858351+schettn@users.noreply.github.com> Date: Thu, 23 May 2024 11:50:47 +0000 Subject: [PATCH] feat: add graphql query for jaenPage and allJaenPage in docs.tsx --- src/pages/docs.tsx | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/pages/docs.tsx b/src/pages/docs.tsx index 9b72494..e22237b 100644 --- a/src/pages/docs.tsx +++ b/src/pages/docs.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Link, HeadFC, PageProps } from "gatsby"; +import { Link, HeadFC, PageProps, graphql } from "gatsby"; import { PageConfig } from "@atsnek/jaen"; const Page: React.FC = () => { @@ -14,3 +14,29 @@ export const pageConfig: PageConfig = { label: "Docs", childTemplates: ["DocPage"], }; + +export const query = graphql` + query ($jaenPageId: String!) { + jaenPage(id: { eq: $jaenPageId }) { + ...JaenPageData + childPages { + ...JaenPageChildrenData + } + } + allJaenPage(filter: { id: { in: ["JaenPage /docs/"] } }) { + nodes { + id + childPagesOrder + jaenPageMetadata { + title + blogPost { + category + } + } + childPages { + ...JaenPageChildrenData + } + } + } + } +`;