{"repo":"remcohaszing/recma-nextjs-static-props","free":true,"listed":false,"github":"https://github.com/remcohaszing/recma-nextjs-static-props","clone":"git clone https://github.com/remcohaszing/recma-nextjs-static-props.git","description":"Expose top-level identifiers in Next.js app.js","language":"JavaScript","stars":21,"topics":["mdx","mdxjs","next","nextjs","unified","recma","recma-plugin"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"recma-nextjs-static-props Generate getStaticProps exposing top level identifiers Table of Contents - Installation - Usage - API - Options - Example - Compatibility - Related Projects - License Installation Usage This plugin is intended for use with Next.js and MDX. It injects a getStaticProps function which exposes all top level identifiers. This means these variable are available in pages/ app.js . This roughly transforms the following MDX: into the following JavaScript: API The default export is a recma plugin which exposes variables from the top-level scope in Next.js through getStaticProps . Options - name : The name of the export to generate. (Default: 'getStaticProps' ) - include : A list to filter identifiers to include in the generated function. This list may include strings which must be matched exactly, a regular expression to test against, or a function that will be called with the value to test, and must return a boolean. If a value is specified which doesn’t exist in the document, it will be ignored. By default everything will be included. - exclude : The same as include , but matching values will be excluded instead. Example The source code repository for this plugin is setup as a Next.js project. It uses both rehype-mdx-title and remark-mdx-frontmatter . To try it yourself, simply clone, install, and run this project: Compatibility This project is compatible with Node.js 16 or greater. Related Projects This plugin works well with the following MDX plugins: - re","default_branch":null,"files":null,"tree":[],"storefront":"/r/remcohaszing","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/remcohaszing/recma-nextjs-static-props/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}