import type { JSXElement } from "solid-js"; import { TableOfContents } from "@/partials/TableOfContents"; import { PrevNextLinks } from "@/components/PrevNextLinks"; import { usePageContext } from "vike-solid/usePageContext"; import { createContext, useContext } from "solid-js"; import { collectSections } from "@/libs/sections"; import { navigation } from "@/libs/navigation"; import { Prose } from "@/components/Prose"; import { MDXProvider } from "solid-jsx"; type DocsLayoutProps = { children: JSXElement; }; const FrontmatterContext = createContext(null); export function DocsLayout(props: DocsLayoutProps) { const pageContext = usePageContext(); console.log("pageContext", pageContext.exports.frontmatter); // undefined // const tableOfContents = collectSections(nodes); return (
{props.children}
{/* */}
); } type DocsHeaderProps = { title?: string; estimatedReadingTime?: string; }; export function DocsHeader(props: DocsHeaderProps) { const { urlPathname } = usePageContext(); const section = navigation.find((section) => section.links.find((link) => link.href === urlPathname), ); if (!props.title && !section) { return null; } return (
{section && (

{section.title}

)} {props.title && (

{props.title}

)} {/* {props.estimatedReadingTime && (

{props.estimatedReadingTime}

)} */}
); }