Skip to content

maxchehab/with-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Next.js + Blog

Import CMS generated .md files in your Next.js project

Installation

npm install --save with-blog

or

yarn add with-blog

Usage

Structured markdown files are compiled from a contentPath directory and a path map is generated with a custom pagePath property.

const withBlog = require("with-blog");

module.exports = withBlog({ 
    contentPath: "content/articles", // directory of .md files
    pagePath: "/article/" // dynamic page route
});

This assumes there is a content directory located at content/articles.

content
└── articles
    ├── a-blog-post.md
    ├── another-blog-post.md
    └── yet-another-blog-post.md

And a dynamic /article/[slug] page.

pages
└── article
    └── [slug].jsx

For more information, check out the example project.

About

Import .md files in your Next.js project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published