The opinionated ecosystem for MDX powered NextJS apps for blogs, documentation, and more.
MDNEXT is an ecosystem of tools to get your NextJS + MDX projects blasting off :rocket:
Looking to start a new project?
# Using NPX we'll start up the mdnext CLI prompts -- npx mdnext
You will first be prompted with.. --
What is the name of your project?
Then you will choose which template to use
Select which template to use ...
Just want to access components in your
# Even though we're a Next based ecosystem, our `MDX` components should be usable in most React based applications
yarn add @mdnext/components
npm i @mdnext/components
mdnextis an ecosystem of tools to empower working with NextJS + MDX.
mdnextCLI surfaces a collection officially maintained and community submitted templates to choose from. Once chosen, the project is cloned locally with a clean commit history and you're ready to build your next project.
@mdnext/componentsdelivers accessible (thanks ChakraUI) and extendable components for working with
MDX. These include things you've seen like
Codecomponents for styling code blocks or
Iframesfor embedding rich content to
mdnexttemplate collection are NextJS based projects with opinions around how to style, handle
MDX(and other data sources), deliver media, and handle your most usual workflows (ecomm / blogs / product pages). While there is an officially maintained collection of templates, I was excited to see and share what the community has created. I know there's many different opinions and comfortabilities as a web developer and want our ecosystem to be accessible.
The basic structure of the
mdnext-startercan be seen throughout all other templates at it's core of how it utilizes
Getting to know this structure will help inform you of the current best practices that are being followed (which are free to interpretation!) and easy enough to plug and play. Let's dive into the starter:
NextJS lets us configure absolute paths for our app. We use this to easily import all of our functions and utilities inside of our
The pages directory defines your routing. Lifecycle methods like
getServerPropsare available at the page level. This is where we consume our MDX content as data to pass to our components.
*_app.js*NextJS allows you to override the App component, which is used to initialize pages. More here
*_document.js*: Allows you to augment our application's and tags.
all-data/index.js: This page is an example of displaying links to all of your individual MDX data pages. Here we use
getStaticPropsto feed the frontmatter of our
MDXfiles for our components.
data/[slug].js: Here we utilize NextJS dynamic routing. By using
getStaticPathswe're able to feed a dynamic slug, handling all of the logic once and applying it to each
MDXdata that we load. This allows us to then match to our data in
getStaticPropsand display that to the page and our components.
index.js: Our page at the root of our app, lives inside of the
srcdirectory holds all of our client code. Our
utilityfunctions, and our
MDXfiles all live here, with the first three available for absolute path imports 👍
next.config.jsFor custom configuration around things like
pageExtensions, and many more, you can utilize
Each template will have it's own
READMEwith explicit documentation pertaining to the additions that make up the new configuration. Otherwise, you will find each template at it's core, starts similarly to
The templates inside of
mdnextwere made to alleviate the friction when starting a new website. Blogs, personal sites, client work, etc can always feel very daunting to get started on.
What do we have to accomplish?
How do we handle styling?
How am I going to handle data?
What's the best way to integrate authentication?
The opinions in these templates will get you started quickly and allow you to customize however you see fit.
Our currently maintained templates:
mdnext-starterThis is the least opinionated template, that all templates are created from. It houses very minimal configuration and opinion outside of an example of sourcing
mdnext-blogThe blog templates adds features on top of our
mdnext-starter. Specifically using
Chakra-UIfor styling. Configuration for blogs posts at the page and content level using our
MDXfiles as routes.
FuseJSfor filtering our blogs posts. Check this template out in action!
mdnext-overlaysWhen becoming a new streamer you are met with many challenges. Eventually you're going to want to setup your own Scenes, animations, and interactions for your stream and it's viewers. Why not use the tools you love to create them? With this configuration you're set up with a base layer for configuring each new scene as a route. Each route contains ways to interact with Twitch API's, your Twitch chat, and information surrounding your stream and it's events!
Our community submitted templates:
mdnext-tailwindWant to get up and running quickly with a
mdnextproject? This is the answer. A proper config alongside a collection of resources to get those new to
mdnext-twin-macroThis starter is configured with
twin.macroas it's choice of styling. This allows you to utilize
Tailwind'sutility classes and
cssmethod for one off styles.
GraphCMSas our datasource, we setup the basics for a blog. It starts you off with a simple example of how you can pull Markdown from GraphCMS and feed it to our UI with our
mdnext-reflexjsReflexjs is a styling library built for speed and excellent developer experience. You can style your components using style props and constraints based on the System UI specifications.