rework/lightweight #12
@ -6,11 +6,8 @@ import { clientOnly } from "vike-solid/clientOnly";
|
|||||||
import { clock } from "solid-heroicons/outline";
|
import { clock } from "solid-heroicons/outline";
|
||||||
import { navigation } from "@/libs/navigation";
|
import { navigation } from "@/libs/navigation";
|
||||||
import { Prose } from "@/components/Prose";
|
import { Prose } from "@/components/Prose";
|
||||||
import { MDXProvider } from "solid-jsx";
|
|
||||||
import { Icon } from "solid-heroicons";
|
import { Icon } from "solid-heroicons";
|
||||||
|
|
||||||
import QuickLinks from "@/components/QuickLinks";
|
|
||||||
|
|
||||||
type DocsLayoutProps = {
|
type DocsLayoutProps = {
|
||||||
children: JSXElement;
|
children: JSXElement;
|
||||||
};
|
};
|
||||||
@ -20,17 +17,15 @@ const TableOfContents = clientOnly(() =>
|
|||||||
);
|
);
|
||||||
|
|
||||||
export function DocsLayout(props: DocsLayoutProps) {
|
export function DocsLayout(props: DocsLayoutProps) {
|
||||||
const {
|
const pageContext = usePageContext();
|
||||||
exports: { frontmatter, readingTime },
|
|
||||||
} = usePageContext();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MDXProvider components={{ QuickLinks, QuickLink: QuickLinks.QuickLink }}>
|
<>
|
||||||
<div class="max-w-2xl min-w-0 flex-auto px-4 py-16 lg:max-w-none lg:pr-0 lg:pl-8 xl:px-16 grow">
|
<div class="max-w-2xl min-w-0 flex-auto px-4 py-16 lg:max-w-none lg:pr-0 lg:pl-8 xl:px-16 grow">
|
||||||
<article>
|
<article>
|
||||||
<DocsHeader
|
<DocsHeader
|
||||||
title={frontmatter?.title}
|
title={pageContext.exports.frontmatter?.title}
|
||||||
estimatedReadingTime={readingTime?.text}
|
estimatedReadingTime={pageContext.exports.readingTime?.text}
|
||||||
/>
|
/>
|
||||||
<Prose>{props.children}</Prose>
|
<Prose>{props.children}</Prose>
|
||||||
</article>
|
</article>
|
||||||
@ -38,7 +33,7 @@ export function DocsLayout(props: DocsLayoutProps) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<TableOfContents fallback={null} />
|
<TableOfContents fallback={null} />
|
||||||
</MDXProvider>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
const Button = () => {
|
|
||||||
return <span>OK</span>;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Button;
|
|
||||||
Loading…
Reference in New Issue
Block a user