goblog

0.0.2 • Public • Published

goBlog

Just another blog middleware for ExpressJs.

Allows you to mount a blog anywhere in an existing Express app. The posts are just markdown or pug files sitting in a directory somewhere.

It will render a blog from static markdown file. If you do't provide a template or themes for your blog. It will return a json object with parsed object from markdown file.

Installing

npm install goblog

Usage

import express from 'express';
const app = express();

import blog from 'express-blog-middleware';

app.use('/blog', blog({
    templateDir: 'template',
    templateDetail: 'detail-post',
    templateList: 'list-post',
    postDir: 'posts',
    postPerPage: 10
});

goBlog will provide two routes:

List of posts

# A page of posts
GET /

If you have spesify /blog/ for goblog, then you can access it to get a list of posts.

Detail post

# A detail post
GET /:postName

We use filename as slug to access it from url. You can simply access it to /blog/:postName

List of features

  • Parsing markdown files
  • Dynamic express view for multi template
  • Display all posts
  • Display detail post
  • Implement blog themes
  • Sort blog by date
  • Filter blog by category / tags
  • Blog Pagination
  • Set pretty slug like a wordpress /:category/:month/:day/:year/:name
  • Create a demo
  • Helper for markdown validation

Package Sidebar

Install

npm i goblog

Weekly Downloads

1

Version

0.0.2

License

MIT

Last publish

Collaborators

  • ibnuhabibie