with-blog
TypeScript icon, indicating that this package has built-in type declarations

0.0.0 • Public • Published

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.

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i with-blog

    Weekly Downloads

    1

    Version

    0.0.0

    License

    MIT

    Unpacked Size

    20 kB

    Total Files

    23

    Last publish

    Collaborators

    • maxchehab