1
0
Fork 0
freesewing/sites/shared/components/mdx/index.js
Joost De Cock ad87a6c7fd chore(dev): Re-folded all docs into one page, dropped viz.js
Did some digging into why the page size had ballooned, and it turns out
it was due to viz.js taking up half the bundle size. So I've dropped the
Dot custom mdx component, and reverted to having all pages served from
one page using getStaticPaths.

Might optimize a bit more later, but for now page size first load JS
went from 816KB to 272KB so that's a big improvement.
2022-10-03 00:14:11 +02:00

34 lines
1.1 KiB
JavaScript

import Popout from '../popout.js'
import Highlight from './highlight.js'
import YouTube from './youtube.js'
import Figure from './figure.js'
import ReadMore from './read-more.js'
//import Dot from './dot.js'
import { Tab, Tabs } from './tabs.js'
import Example from './example/index.js'
const mdxCustomComponents = (app = false) => ({
// Custom components
Comment: (props) => <Popout {...props} comment />,
Fixme: (props) => <Popout {...props} fixme />,
Link: (props) => <Popout {...props} link />,
Note: (props) => <Popout {...props} note />,
ReadMore: (props) => <ReadMore {...props} app={app} slug={app.slug} />,
Related: (props) => <Popout {...props} related />,
Tip: (props) => <Popout {...props} tip />,
Warning: (props) => <Popout {...props} warning />,
YouTube,
pre: (props) => <Highlight {...props} />,
img: Figure,
//Dot,
table: (props) => (
<table {...props} className="mdx-table table-auto w-full">
{props.children}
</table>
),
Tab,
Tabs,
Example: (props) => <Example {...props} app={app} />,
})
export default mdxCustomComponents