{"id":14384443,"url":"https://github.com/JS-DevTools/next-mdx","last_synced_at":"2025-08-23T17:32:13.980Z","repository":{"id":57122437,"uuid":"288032839","full_name":"JS-DevTools/next-mdx","owner":"JS-DevTools","description":"Adds support for MDX with advanced syntax features in Next.js applications","archived":false,"fork":false,"pushed_at":"2020-10-31T13:05:37.000Z","size":694,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-15T01:30:47.093Z","etag":null,"topics":["javascript","mdx","nextjs","nodejs","react","rehype-plugin","remark-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JS-DevTools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-16T22:12:56.000Z","updated_at":"2022-09-26T07:33:37.000Z","dependencies_parsed_at":"2022-08-24T14:57:01.267Z","dependency_job_id":null,"html_url":"https://github.com/JS-DevTools/next-mdx","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JS-DevTools%2Fnext-mdx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JS-DevTools%2Fnext-mdx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JS-DevTools%2Fnext-mdx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JS-DevTools%2Fnext-mdx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JS-DevTools","download_url":"https://codeload.github.com/JS-DevTools/next-mdx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230716520,"owners_count":18269780,"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":["javascript","mdx","nextjs","nodejs","react","rehype-plugin","remark-plugin"],"created_at":"2024-08-28T18:01:23.540Z","updated_at":"2024-12-21T12:30:36.000Z","avatar_url":"https://github.com/JS-DevTools.png","language":"JavaScript","readme":"Advanced MDX support for Next.js\n==============================================\n### Adds support for MDX with advanced syntax features in Next.js applications\n\n[![Cross-Platform Compatibility](https://jstools.dev/img/badges/os-badges.svg)](https://github.com/JS-DevTools/next-mdx/actions)\n[![Build Status](https://github.com/JS-DevTools/next-mdx/workflows/CI-CD/badge.svg)](https://github.com/JS-DevTools/next-mdx/actions)\n\n[![Coverage Status](https://coveralls.io/repos/github/JS-DevTools/next-mdx/badge.svg?branch=master)](https://coveralls.io/github/JS-DevTools/next-mdx)\n[![Dependencies](https://david-dm.org/JS-DevTools/next-mdx.svg)](https://david-dm.org/JS-DevTools/next-mdx)\n\n[![npm](https://img.shields.io/npm/v/@jsdevtools/next-mdx.svg)](https://www.npmjs.com/package/@jsdevtools/next-mdx)\n[![License](https://img.shields.io/npm/l/@jsdevtools/next-mdx.svg)](LICENSE)\n[![Buy us a tree](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-lightgreen)](https://plant.treeware.earth/JS-DevTools/next-mdx)\n\n\n\nThis library wraps [the official Next.js + MDX plugin](https://github.com/vercel/next.js/tree/canary/packages/next-mdx) and configures it with additional [Remark](https://github.com/remarkjs/remark) and [Rehype](https://github.com/rehypejs/rehype) plugins to enable advanced Markdown syntax and make MDX easier to use for our specific use-cases.\n\n\n\nFeatures\n--------------------------\n\n- Adds support for YAML frontmatter\n  - Automatically adds `createdAt` and `modifiedAt` frontmatter fields. Useful for populating `\u003cmeta\u003e` tags for SEO and social media.\n  - Adds support for a `layout` frontmatter field, which can be used to customize the React layout component to use for each MDX page.\n\n- Passes a `markdown` boolean to React components to indicate whether they originally came from Markdown syntax. This allows you to distinguish between `**bold**` and `\u003cb\u003ebold\u003c/b\u003e`  which can be used to apply different styling, or even render completely different JSX.\n\n- Rewrites links to MDX files (e.g. `/pages/docs/some-page.mdx` becomes `/pages/docs/some-page`)\n\n- Detects broken links to MDX files\n\n\n\nUsage\n--------------------------\nInstall the library via [npm](https://docs.npmjs.com/about-npm/):\n\n```bash\nnpm install @jsdevtools/next-mdx\n```\n\nThen use it in your `next.config.js` file:\n\n```javascript\nconst nextMDX = require(\"@jsdevtools/next-mdx\");\n\nconst withMDX = nextMDX({\n  // Next-MDX options go here\n  siteURL: \"http://example.com\"\n});\n\nmodule.exports = withMDX({\n  // Next.js options go here\n  pageExtensions: [\"tsx\", \"mdx\"],\n});\n```\n\n\n\nOptions\n--------------------------------\nSee [`options.ts`](src/options.ts) for all of the options that you can pass to Next-MDX.\n\n\u003e **NOTE:** Don't confuse the Next-MDX options with the Next.js options.\n\u003e Refer to the code example above to see where each goes.\n\n\n\nContributing\n--------------------------\nContributions, enhancements, and bug-fixes are welcome!  [Open an issue](https://github.com/JS-DevTools/next-mdx/issues) on GitHub and [submit a pull request](https://github.com/JS-DevTools/next-mdx/pulls).\n\n#### Building\nTo build the project locally on your computer:\n\n1. __Clone this repo__\u003cbr\u003e\n`git clone https://github.com/JS-DevTools/next-mdx.git`\n\n2. __Install dependencies__\u003cbr\u003e\n`npm install`\n\n3. __Build the code__\u003cbr\u003e\n`npm run build`\n\n4. __Run the tests__\u003cbr\u003e\n`npm test`\n\n\n\nLicense\n--------------------------\nNext MDX is 100% free and open-source, under the [MIT license](LICENSE). Use it however you want.\n\nThis package is [Treeware](http://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/JS-DevTools/next-mdx) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.\n\n\n\nBig Thanks To\n--------------------------\nThanks to these awesome companies for their support of Open Source developers ❤\n\n[![GitHub](https://jstools.dev/img/badges/github.svg)](https://github.com/open-source)\n[![NPM](https://jstools.dev/img/badges/npm.svg)](https://www.npmjs.com/)\n[![Coveralls](https://jstools.dev/img/badges/coveralls.svg)](https://coveralls.io)\n[![Travis CI](https://jstools.dev/img/badges/travis-ci.svg)](https://travis-ci.com)\n[![SauceLabs](https://jstools.dev/img/badges/sauce-labs.svg)](https://saucelabs.com)\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJS-DevTools%2Fnext-mdx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJS-DevTools%2Fnext-mdx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJS-DevTools%2Fnext-mdx/lists"}