Replies: 4 comments
-
Some background here: I'm trying to build a website, where one of the page can show all the titles, dates of my blog posts. (Actually I'm not sure if these two functions are from the Any comments will be welcomed. |
Beta Was this translation helpful? Give feedback.
-
OK, based on here: https://mdxjs.com/guides/frontmatter/ import solid from "solid-start/vite";
import { defineConfig } from "vite";
import unocss from "unocss/vite";
import unocssPlugin from "unocss/vite";
import mdx from "@mdx-js/rollup";
import remarkGfm from "remark-gfm";
import remarkFrontmatter from "remark-frontmatter"; // YAML and such. <--------- HERE
export default defineConfig({
plugins: [
unocssPlugin(),
unocss(),
{
...(await import("@mdx-js/rollup")).default({
jsx: true,
jsxImportSource: "solid-js",
providerImportSource: "solid-mdx",
remarkPlugins: [remarkGfm, remarkFrontmatter], <--------- HERE
}),
enforce: "pre",
},
solid({
extensions: [".mdx", ".md"],
ssr: true,
}),
],
}); But I'm still unable to utilize the |
Beta Was this translation helpful? Give feedback.
-
To me it looks like |
Beta Was this translation helpful? Give feedback.
-
You can try vite-plugin-solid-markdown
You can try vite-plugin-solid-markdown |
Beta Was this translation helpful? Give feedback.
-
I'm trying to use this piece of code (from solid-start repo) to import my
mdx
ormd
files:solid-start/docs.root.tsx
Line 20 in b2a09b3
However, if I don't activate
mdx
in thevite.config.ts
, thegetHeadings()
andgetFrontMatter()
functions are not available.If I add
mdx
to thevite.config.ts
as the doc shows:When I start the server, I get this error:
If I do
Then the the frontmatter of the
mdx
files cannot be parsed correctly:It seems I cannot get the
mdx
package work withsolidjs
anyhow...Beta Was this translation helpful? Give feedback.
All reactions