JSPM

  • Created
  • Published
  • Downloads 716
  • Score
    100M100P100Q97088F
  • License MIT

A Markdown Blog for Your Node App

Package Exports

  • writr

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (writr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Writr - A Markdown Blog for Your Node App CircleCI

Initial Setup and Structure

  • Setup your content in a directory like so:
blog/... << Articles go here>>
blog/content... << Images and other content that you link to go here>>

We will default to the blog/ folder unless you configure the custom path in the configuration.

  • Create your Markdown Documents with the following Meta Header
{
    "title": "",
    "author": "",
    "url": "",
    "createdAt": "",
    "publishedAt": "",
    "keywords": "",
    "tags": ""
}

How to use with Express

  • Instal the module yarn add writr or if using Typescript do yarn add @types/writr
  • Add it to your Express app such as the following code example:
var express = require('express');
var app = express();

var writr = require('writr');

writer.initExpress('/blog', app);

Express with Configuration

var express = require('express');
var app = express();

var writr = require('writr');

writer.initExpress('/blog', app, {
    contentPath: './public/content',
    postPath: './_posts',
    templatePath: './views/blog'
});

Markdown

To learn more about Markdown go here: https://guides.github.com/features/mastering-markdown/

Templates

There are three templates that are part of every instance of Writr:

  • home: This is the main template that lists all of the latest blogs or what you want to add.
  • post: The post itself and usually supporting items around that such as what is next to look at and tags.
  • tags: Showing articles by tag filtering.