1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 18:30:30 -04:00
jarv.is/lib/mdx-components.ts

25 lines
1.4 KiB
TypeScript

import dynamic from "next/dynamic";
// Bundle these components by default:
export { default as Image } from "../components/Image/Image";
export { default as Figure } from "../components/Figure/Figure";
// These (mostly very small) components are direct replacements for HTML tags generated by remark:
export { default as a } from "../components/Link/Link";
export { default as code } from "../components/CodeBlock/CodeBlock";
export { default as blockquote } from "../components/Blockquote/Blockquote";
export { default as hr } from "../components/HorizontalRule/HorizontalRule";
export { H1 as h1, H2 as h2, H3 as h3, H4 as h4, H5 as h5, H6 as h6 } from "../components/Heading/Heading";
export { UnorderedList as ul, OrderedList as ol, ListItem as li } from "../components/List/List";
// ...and these components are technically passed into all posts, but next/dynamic ensures they're loaded only
// when they're referenced in the individual mdx files.
export const IFrame = dynamic(() => import("../components/IFrame/IFrame"));
export const Video = dynamic(() => import("../components/Video/Video"));
export const YouTube = dynamic(() => import("../components/YouTubeEmbed/YouTubeEmbed"));
export const Tweet = dynamic(() => import("../components/TweetEmbed/TweetEmbed"));
export const Gist = dynamic(() => import("../components/GistEmbed/GistEmbed"));
// One-offs for specific posts:
export const OctocatLink = dynamic(() => import("../components/OctocatLink/OctocatLink"));