with-blog
v0.0.0
Published
Import CMS generated `.md` files in your Next.js project
Downloads
1
Readme
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.