I am trying to create a static blog using rescript-remix
When routing like this, I can see the mdx contents in route /test
, but I don’t know how to import the mdx contents in res-routes
.
I want do this Remix | MDX
I am trying to create a static blog using rescript-remix
When routing like this, I can see the mdx contents in route /test
, but I don’t know how to import the mdx contents in res-routes
.
I want do this Remix | MDX
Idk how remix works, but reading its documentation, I guess that you can do something like that in your rescript module:
module PostMdx = {
@module("./first-post.mdx") external attributes: {..} = "attributes"
@module("./first-post.mdx") external filename: {..} = "filename"
}
The generated javascript will be something like:
import * as FirstPostMdx from "./first-post.mdx";
var attributes = FirstPostMdx.attributes;
var filename = FirstPostMdx.filename;
Which is very similar to the original remix example (in JavaScript):