0.0.0 • Published 6 years ago
with-blog v0.0.0
Next.js + Blog
Import CMS generated .md files in your Next.js project
Installation
npm install --save with-blogor
yarn add with-blogUsage
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.mdAnd a dynamic /article/[slug] page.
pages
└── article
└── [slug].jsxFor more information, check out the example project.
0.0.0
6 years ago