Skip to content

Commit

Permalink
mdx restructure dirs (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
benorloff committed Apr 24, 2024
1 parent 8d177fa commit 6eabf07
Show file tree
Hide file tree
Showing 32 changed files with 216 additions and 412 deletions.
30 changes: 8 additions & 22 deletions app/docs/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { format, parseISO } from 'date-fns'
import { allDocs } from 'contentlayer/generated'
import { getMDXComponent } from 'next-contentlayer/hooks'
import { Breadcrumbs } from '@/components/breadcrumbs'
import { Demo } from '@/components/demo'
import { HoverGridCode } from '@/app/gluons/hover-grid/_demo/hover-grid-code'
import { HoverGridPreview } from '@/app/gluons/hover-grid/_demo/hover-grid-preview'
import { Mdx } from '@/components/mdx-components'

interface DocPageProps {
params: {
Expand Down Expand Up @@ -39,28 +35,18 @@ const DocPage = ({

if (!doc) throw new Error(`doc not found for slug: ${params.slug}`)

const Content = getMDXComponent(doc.body.code)

if (!doc) throw new Error(`doc not found for slug: ${params.slug}`)

const previewCodeTitle = doc.title.toLowerCase().replace(/\s/g, '-')

return (
<div>
<section className="w-full space-y-2">
<Breadcrumbs />
<h1 className="text-4xl font-semibold">{doc.title}</h1>
<p className="text-muted-foreground">{doc.description}</p>
<h1 className="text-4xl font-semibold">
{doc.title}
</h1>
<p className="text-muted-foreground">
{doc.description}
</p>
<Mdx code={doc.body.code}/>
</section>
<Demo
title={`${previewCodeTitle}.tsx`}
lang="tsx"
code={HoverGridCode}
lineNumbers={true}
className="!my-0"
>
<HoverGridPreview />
</Demo>
</div>
)
}
Expand Down
7 changes: 0 additions & 7 deletions app/gluons/carousel/_demo/carousel-preview.tsx

This file was deleted.

40 changes: 0 additions & 40 deletions app/gluons/carousel/page.tsx

This file was deleted.

This file was deleted.

41 changes: 0 additions & 41 deletions app/gluons/content-accordion/page.tsx

This file was deleted.

82 changes: 0 additions & 82 deletions app/gluons/hover-grid/_demo/hover-grid-code.tsx

This file was deleted.

36 changes: 0 additions & 36 deletions app/gluons/hover-grid/page.tsx

This file was deleted.

32 changes: 0 additions & 32 deletions app/gluons/layout.tsx

This file was deleted.

71 changes: 0 additions & 71 deletions app/gluons/playground/page.tsx

This file was deleted.

2 changes: 2 additions & 0 deletions components/demo-code.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server"

import { Code, BrightProps} from "bright";

interface DemoCodeProps {
Expand Down
Loading

0 comments on commit 6eabf07

Please sign in to comment.