Adam Laycock

Results 60 comments of Adam Laycock
trafficstars

Let's take react hooks as an example. I have a hook called `useForm` that returns an object. The _react way_ would be to do this: ```ts const MyComponent: React.FC =...

mdx-bundler can absolutely take a string from your CMS and bundle it! In your `getStaticProps` you need to use `bundleMDX` to turn the string into a bundle, then pass it...

Sounds like an error in the MDX, what is line 23 excluding any frontmatter, of the MDX you are getting from your cms?

MDX doesn't [support indented code](https://github.com/wooorm/xdm#caveats) like that, wrapping it in ```js and ``` fixes the problem for me.

What does the HTML look like? Has it put in `` and `` tags? I know tailwind resets everything to a level playing field so it may just be a...

Looks like mdx-bundler is doing its job :) Is [tailwind-typography](https://github.com/tailwindlabs/tailwindcss-typography) installed and configured?

Syntax highlight is possible with a remark plugin, I use [remarkHighlight](https://github.com/remarkjs/remark-highlight.js?files=1) to do it [on my site](https://github.com/Arcath/arcath.net-next/blob/main/lib/functions/prepare-mdx.ts#L25)

The return from `getStaticProps` needs to be an object with a `props` object that gets passed to your component for example: ```js export const getStaticProps = async ({ params })...

Looking at it this seems like something an esbuild plugin could do. You could then pass the plugin into mdx-bundler so it can generate the file at the same time.

it would need to be a [esbuild plugin](https://esbuild.github.io/plugins/#concepts) that has a filter of `*.gif` and then applies your script to it.