12 | A modern MDX and Next.js starter made by{" "} 13 | brijr. Built with Next.js, Velite, 14 | and Tailwind CSS. View it on{" "} 15 | GitHub. 16 |
17 |
35 | No posts yet. Create your first post in the{" "}
36 |
37 | content/
38 |
39 | directory.
40 |
{description}
} 25 | {hasMeta && ( 26 |58 | {excerpt} 59 |
60 | )} 61 |
27 | {children}
28 |
29 | );
30 | }
31 |
32 | const language = className?.replace("language-", "");
33 | return {children as string};
34 | },
35 | p: ({ children }: { children: React.ReactNode }) => {
36 | if (
37 | React.Children.toArray(children).some(
38 | (child) =>
39 | React.isValidElement(child) &&
40 | /^(pre|div|table)$/.test(
41 | (child.type as any)?.name || child.type || ""
42 | )
43 | )
44 | ) {
45 | return <>{children}>;
46 | }
47 | return {children}
; 48 | }, 49 | blockquote: ({ children }: { children: React.ReactNode }) => ( 50 |{children}51 | ), 52 | img: ({ 53 | src, 54 | alt, 55 | className, 56 | }: { 57 | src?: string; 58 | alt?: string; 59 | width?: number | string; 60 | height?: number | string; 61 | className?: string; 62 | }) => { 63 | if (!src) return null; 64 | return
101 | {metadata.description} 102 |
103 | )} 104 |
73 |
74 | {tokens.map((line, i) => (
75 |
76 | {line.map((token, key) => (
77 |
78 | ))}
79 |
80 | ))}
81 |
82 |
83 | )}
84 |
99 |
100 | {tokens.map((line, i) => (
101 |
102 | {line.map((token, key) => (
103 |
104 | ))}
105 |
106 | ))}
107 |
108 |
109 | )}
110 | 163 | {body} 164 |
165 | ) 166 | }) 167 | FormMessage.displayName = "FormMessage" 168 | 169 | export { 170 | useFormField, 171 | Form, 172 | FormItem, 173 | FormLabel, 174 | FormControl, 175 | FormDescription, 176 | FormMessage, 177 | FormField, 178 | } 179 | -------------------------------------------------------------------------------- /components/ds.tsx: -------------------------------------------------------------------------------- 1 | // Design system components for layout and prose styling. 2 | // Provides reusable components for structuring pages and formatting rich text content. 3 | 4 | import { cn } from "@/lib/utils"; 5 | 6 | type DSProps = { 7 | className?: string; 8 | children?: React.ReactNode; 9 | id?: string; 10 | style?: React.CSSProperties; 11 | dangerouslySetInnerHTML?: { __html: string }; 12 | containerClassName?: string; 13 | isArticle?: boolean; 14 | isSpaced?: boolean; 15 | }; 16 | 17 | export const Section = ({ children, className, id, style }: DSProps) => ( 18 |