eratic / packages / core / src / components / mdx.ts
155 words
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
 * Components available inside every .mdx entry without an import.
 *
 * Passed to <Content components={mdxComponents} /> by the entry routes. MDX
 * resolves any capitalised tag it does not find an import for against this
 * map, which means an article can just write:
 *
 *   <Figure src={frontmatter.cover} alt="…" width="wide" exif />
 *   <Aside>A note in the margin.</Aside>
 *
 * with no import line at the top. That matters here because posts are written
 * by handing an LLM a prompt, and every import line is a chance to get a
 * relative path wrong.
 *
 * Importing a component explicitly still works and takes precedence — that is
 * how you use a one-off component built for a single article.
 */

import Figure from './Figure.astro';
import PhotoGrid from './PhotoGrid.astro';
import Video from './Video.astro';
import Bleed from './Bleed.astro';
import Aside from './Aside.astro';

export const mdxComponents = {
	Figure,
	PhotoGrid,
	Video,
	Bleed,
	Aside,
};

static mirror of HEAD · about · clone: git clone https://git.makefuture.ro/eratic.git