{"id":17717153,"url":"https://github.com/arn4v/next-mdx-builder","last_synced_at":"2025-03-14T02:31:09.303Z","repository":{"id":96542026,"uuid":"391353197","full_name":"arn4v/next-mdx-builder","owner":"arn4v","description":"Next.js plugin that adds support for MDX pages via `next-mdx-remote`","archived":false,"fork":false,"pushed_at":"2021-08-02T12:45:07.000Z","size":134,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-04T22:18:19.870Z","etag":null,"topics":["mdx","nextjs","react"],"latest_commit_sha":null,"homepage":"https://npmjs.org/package/next-mdx-builder","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arn4v.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-31T12:41:53.000Z","updated_at":"2022-06-23T21:05:28.000Z","dependencies_parsed_at":"2023-04-04T06:17:04.477Z","dependency_job_id":null,"html_url":"https://github.com/arn4v/next-mdx-builder","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"63216b31c46c8e8b24c7ec7b4a5dbb675c9db93b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arn4v%2Fnext-mdx-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arn4v%2Fnext-mdx-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arn4v%2Fnext-mdx-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arn4v%2Fnext-mdx-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arn4v","download_url":"https://codeload.github.com/arn4v/next-mdx-builder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243511636,"owners_count":20302590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mdx","nextjs","react"],"created_at":"2024-10-25T14:12:05.822Z","updated_at":"2025-03-14T02:31:09.294Z","avatar_url":"https://github.com/arn4v.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# next-mdx-builder\n\nNext.js plugin that adds MDX pages support via next-mdx-remote \u0026 a custom Webpack plugin.\n\n## Note\n\n- This has only been tested with Next.js 11 (Webpack 5).\n- Requires Node.js \u003e= 14\n\n## Install\n\n```shell\nyarn add next-mdx-builder\n```\n\n```shell\nnpm i --save next-mdx-builder\n```\n\n## API Reference\n\n```ts\ntype PluginOptions = SerializeOptions;\n```\n\nSerializeOptions: https://github.com/hashicorp/next-mdx-remote/blob/main/src/types.ts#L2\n\n## Usage\n\n#### Plugin\n\nAdd and configure plugin in `next.config.js`:\n\n```js\n// next.config.js\nconst withMdxBuilder = require(\"next-mdx-builder\")({\n  mdxOptions: {\n    remarkPlugins: [require(\"remark-gfm\")],\n    rehypePlugins: [require(\"mdx-prism\")],\n  },\n});\n\nmodule.exports = withMdxBuilder(/** Next Config */ {});\n```\n\n#### pages\n\n**Directory tree:**\n\n```\n- layouts/\n    - docs.jsx\n- pages/\n    - docs/\n        - introduction.mdx\n```\n\n**MDX (pages/docs/introduction.mdx):**\n\n```markdown\n---\ntitle: Introduction\nlayout: \"../../layouts/docs\"\n---\n\n# Docs Introduction Page\n```\n\n**Layout:**\n\n```jsx\nexport default function DocsPage({ children, frontMatter }) {\n  return (\n    \u003c\u003e\n      \u003ch1\u003e{frontMatter.title}\u003c/h1\u003e\n      {children}\n    \u003c/\u003e\n  );\n}\n```\n\n## Acknowledgements\n\n- Modeled after [hashicorp/next-mdx-enhanced](https://github.com/hashicorp/next-mdx-enhanced) and [shuding/nextra](https://github.com/shuding/nextra)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farn4v%2Fnext-mdx-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farn4v%2Fnext-mdx-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farn4v%2Fnext-mdx-builder/lists"}