Replies: 1 comment 2 replies
-
Afaik the RSS item My recommendation: do not rely on a best-effort excerpt generation fallback or try to improve it. Instead, always provide an explicit Keep in mind that what you try to do (MDX to HTML) might be costly. Our excerpt generation is much simpler on purpose for that reason. Also if you use markdown tables, interactive React components, tabs, and other fancy things at the beginning of a post, it's unlikely any system will be able to infer a proper description that would be better than an explicitly defined one. However, if you don't like our default excerpt generation, you have multiple hooks to customize it:
The error you get is likely because MDX is using ESM. You likely need to use dynamic imports like we do: async function mdxToHtml(mdxString: string) {
const {compileSync} = await import('@mdx-js/mdx')
// ...
} |
Beta Was this translation helpful? Give feedback.
-
I'm trying to get better descriptions into my RSS feed (ideally the entire post summary, not just the first sentence). I have the MDX source in hand, but unfortunately, I'm having a hard time getting some reasonable mdx-to-html action going:
import { compileSync } from "@mdx-js/mdx";
) throws a gnarly and odd error:[cause]: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/chas/dev/site/node_modules/estree-walker/package.json
. (Perhaps this is a jiti problem? Use shiki for code highlight #9122 (comment) is the only thing I've found that appears similar.)Any thoughts on how to go about this?
Beta Was this translation helpful? Give feedback.
All reactions