kaf-lamed-beyt / nextjs-blog-template

A blog template built with Next.js, next-mdx-remote (MDX), and some rehype plugins to get you up and running
8 stars 2 forks source link
blog mdx next-mdx-remote nextjs rehype

If you've always wanted to have a dev blog of your own, this repository is a blog template that I built with Next.js and MDX.

You can fork or clone the repository and use it and use it as you want.

Overview of the folders and files

So instead of doing something like the snippet below

import SomeComponent from "./../../path/to/directory/";

You can simply do this.

import SomeComponent from "@componentDir/component-name";

You can also tweak the config file to your taste.

{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "@components/*": ["src/components/*"],
      "@mdx-components/*": ["src/components/mdx-components/*"],
      "@styles/*": ["/styles/*"],
      "@utils/*": ["src/utils/*"]
      // you can add your file path mappings here
    }
  }
}

The tools used in building this template

npm install gray-matter
npm install reading-time
npm install next-mdx-remote@3.0.8

Check this github issue to understand why you shouldn't install the latest version

npm install glob
npm install dayjs
npm install rehype-highlight
npm install rehype-autolink-headings
npm install rehype-code-titles
npm install rehype-slug

Want to contribute?

Read this guide to see how you can contribute to this project.