File tree Expand file tree Collapse file tree 9 files changed +323
-2
lines changed
Expand file tree Collapse file tree 9 files changed +323
-2
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,29 @@ export default async function Page(props: {
1212 if ( ! page ) notFound ( ) ;
1313
1414 const MDX = ( page . data as any ) . _exports ?. default || ( page . data as any ) . exports ?. default ;
15+ const githubPath = params . slug
16+ ? `apps/site/content/docs/${ params . slug . join ( '/' ) } .mdx`
17+ : 'apps/site/content/docs/index.mdx' ;
1518
1619 return (
1720 < DocsPage
1821 toc = { ( page . data as any ) . toc ?? [ ] }
1922 full = { false }
23+ footer = { {
24+ children : (
25+ < a
26+ href = { `https://github.com/objectstack-ai/objectos/blob/main/${ githubPath } ` }
27+ target = "_blank"
28+ rel = "noreferrer noopener"
29+ className = "inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors"
30+ >
31+ < svg className = "size-4" fill = "none" stroke = "currentColor" viewBox = "0 0 24 24" >
32+ < path strokeLinecap = "round" strokeLinejoin = "round" strokeWidth = { 2 } d = "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
33+ </ svg >
34+ Edit this page on GitHub
35+ </ a >
36+ ) ,
37+ } }
2038 >
2139 < DocsBody >
2240 < h1 > { page . data . title } </ h1 >
Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ export default function Layout({ children }: { children: ReactNode }) {
99 < DocsLayout
1010 tree = { pageTree }
1111 { ...baseOptions }
12+ sidebar = { {
13+ collapsible : true ,
14+ defaultOpenLevel : 0 ,
15+ } }
1216 >
1317 { children }
1418 </ DocsLayout >
Original file line number Diff line number Diff line change 11@import 'tailwindcss' ;
22@import 'fumadocs-ui/style.css' ;
3+ @import 'fumadocs-twoslash/twoslash.css' ;
34
45@theme {
56 /* Colors - using CSS custom properties */
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export const baseOptions: BaseLayoutProps = {
1414 < span className = "font-bold" > ObjectOS</ span >
1515 </ div >
1616 ) ,
17+ transparentMode : 'top' ,
1718 } ,
1819 links : [
1920 {
@@ -29,6 +30,8 @@ export const baseOptions: BaseLayoutProps = {
2930 {
3031 text : 'GitHub' ,
3132 url : 'https://github.com/objectstack-ai/objectos' ,
33+ external : true ,
3234 } ,
3335 ] ,
36+ githubUrl : 'https://github.com/objectstack-ai/objectos' ,
3437} ;
Original file line number Diff line number Diff line change @@ -11,7 +11,16 @@ export default function Layout({ children }: { children: ReactNode }) {
1111 return (
1212 < html lang = "en" className = { inter . className } suppressHydrationWarning >
1313 < body >
14- < RootProvider > { children } </ RootProvider >
14+ < RootProvider
15+ search = { {
16+ enabled : true ,
17+ options : {
18+ type : 'static' ,
19+ } ,
20+ } }
21+ >
22+ { children }
23+ </ RootProvider >
1524 </ body >
1625 </ html >
1726 ) ;
Original file line number Diff line number Diff line change 1111 },
1212 "dependencies" : {
1313 "fumadocs-core" : " ^16.4.7" ,
14+ "fumadocs-docgen" : " ^3.0.5" ,
1415 "fumadocs-mdx" : " ^14.2.6" ,
16+ "fumadocs-twoslash" : " ^3.1.12" ,
1517 "fumadocs-ui" : " ^16.4.7" ,
1618 "lucide-react" : " ^0.562.0" ,
1719 "next" : " ^16.1.4" ,
Original file line number Diff line number Diff line change 11import { defineDocs , defineConfig , defineCollections } from 'fumadocs-mdx/config' ;
22import { z } from 'zod' ;
3+ import { remarkInstall } from 'fumadocs-docgen' ;
4+ import { rehypeCodeDefaultOptions } from 'fumadocs-core/mdx-plugins' ;
5+ import { transformerTwoslash } from 'fumadocs-twoslash' ;
36
47export const { docs, meta } = defineDocs ( {
58 dir : 'content/docs' ,
@@ -16,4 +19,18 @@ export const blog = defineCollections({
1619 type : 'doc' ,
1720} ) ;
1821
19- export default defineConfig ( ) ;
22+ export default defineConfig ( {
23+ mdxOptions : {
24+ remarkPlugins : [ remarkInstall ] ,
25+ rehypeCodeOptions : {
26+ themes : {
27+ light : 'github-light' ,
28+ dark : 'github-dark' ,
29+ } ,
30+ transformers : [
31+ ...( rehypeCodeDefaultOptions . transformers ?? [ ] ) ,
32+ transformerTwoslash ( ) ,
33+ ] ,
34+ } ,
35+ } ,
36+ } ) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ const config: Config = {
99 './lib/**/*.{ts,tsx}' ,
1010 './mdx-components.{ts,tsx}' ,
1111 './node_modules/fumadocs-ui/dist/**/*.js' ,
12+ './node_modules/fumadocs-twoslash/dist/**/*.js' ,
13+ ] ,
14+ plugins : [
15+ require ( '@tailwindcss/typography' ) ,
1216 ] ,
1317} ;
1418
You can’t perform that action at this time.
0 commit comments