# with-blog

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

Latest version **0.0.0** (published 2019-11-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install with-blog
pnpm add with-blog
yarn add with-blog
bun add with-blog
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.0 |
| Published | 2019-11-21 |
| First published | 2019-11-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 19.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | maxchehab |

## Links

- npm: https://www.npmjs.com/package/with-blog
- Repository: https://github.com/maxchehab/with-blog
- npm.io page: https://npm.io/package/with-blog

## Dependencies (1)

- [frontmatter-markdown-loader](https://npm.io/package/frontmatter-markdown-loader.md) 3.1.0

## Recent versions

- 0.0.0 (latest) — 2019-11-21

## 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](https://nextjs.org/docs#static-html-export) is generated with a custom `pagePath` property.

```js
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](https://github.com/maxchehab/with-blog/tree/master/examples/simple-blog).

---
_Source: https://npm.io/package/with-blog · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
