API Reference

post Class

Defined in lib/post/index.js:1

Description

Post functions.

Methods

create

(data, [replace=false], callback) static

Creates a new post.

Parameters

load

([options], [callback]) static
Defined in lib/post/load.js:4

Loads post files.

This function does:

  • theme/process: Processes theme files
  • theme/watch: Watches theme files (When options.watch is true)
  • source/process: Processes source files
  • source/watch: Watches source files (When options.watch is true)
  • theme/generate: Runs generators

Parameters

publish

(data)

Publish a draft.

Parameters

render

(source, data, callback) static

Renders post contents.

Rendering flow:

  • Compiles with Swig
  • Runs before_post_render filter
  • Compiles with Markdown (or other render engines, depends on the extension name of source files)
  • Runs after_post_render filter

Parameters