1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 09:05:22 -04:00
jarv.is/lib/helpers/mdx-components.ts

26 lines
1.4 KiB
TypeScript

import dynamic from "next/dynamic";
// Bundle these components by default:
export { default as Image } from "../../components/Image";
export { default as Figure } from "../../components/Figure";
// These (mostly very small) components are direct replacements for HTML tags generated by remark:
export { default as a } from "../../components/Link";
export { default as code } from "../../components/Code";
export { default as blockquote } from "../../components/Blockquote";
export { default as hr } from "../../components/HorizontalRule";
export { H1 as h1, H2 as h2, H3 as h3, H4 as h4, H5 as h5, H6 as h6 } from "../../components/Heading";
export { UnorderedList as ul, OrderedList as ol, ListItem as li } from "../../components/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"));
export const Video = dynamic(() => import("../../components/Video"));
export const YouTube = dynamic(() => import("../../components/YouTubeEmbed"));
export const Tweet = dynamic(() => import("../../components/TweetEmbed"));
export const Gist = dynamic(() => import("../../components/GistEmbed"));
export const CodePen = dynamic(() => import("../../components/CodePenEmbed"));
// One-offs for specific posts:
export const OctocatLink = dynamic(() => import("../../components/OctocatLink"));