You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to pull out a list of IDs that are within my MDX which will match the regex of const TWEET_RE = /<StaticTweet\sid="[0-9]+"\s\/>/g; that I can then use to perform getStaticProps.
I was wondering if there's an easy way to modify the makeSource config folder so that I can simply map over the individual file contents within my target folder to extract these IDs.
This is my existing makeSource config.
exportdefaultmakeSource({contentDirPath: "posts",documentTypes: [Post],mdx: {rehypePlugins: [[rehypePrettyCode,{// theme: "github-dark",theme: JSON.parse(readFileSync(themePath,"utf-8")),onVisitLine(node: any){// Prevent lines from collapsing in `display: grid` mode, and allow empty// lines to be copy/pastedif(node.children.length===0){node.children=[{type: "text",value: " "}];}},onVisitHighlightedLine(node: any){node.properties.className.push("line--highlighted");},onVisitHighlightedWord(node: any){node.properties.className=["word--highlighted"];},},],],},});
This discussion was converted from issue #424 on April 24, 2023 14:34.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi team,
I'm trying to pull out a list of IDs that are within my MDX which will match the regex of
const TWEET_RE = /<StaticTweet\sid="[0-9]+"\s\/>/g;
that I can then use to perform getStaticProps.Mainly trying to follow this specific tutorial : https://blog.maximeheckel.com/posts/static-tweets-with-mdx-nextjs/
I was wondering if there's an easy way to modify the makeSource config folder so that I can simply map over the individual file contents within my target folder to extract these IDs.
This is my existing makeSource config.
Thank you so much!
Beta Was this translation helpful? Give feedback.
All reactions