Skip to main content
100%

Drafting and publishing a blog post (in docpad) using [frontman](https://github.com/Hypercubed/frontman)

✓ Published0🌍 Public
HHypercubed
Last edited Sep 21, 2013
Created on Sep 20, 2013

This example demonstrates how to draft and publish a blog post using the frontman command-line tool within a DocPad project. It shows the workflow of creating a new post from a draft template and then publishing it to a dated archive directory. The code uses frontman’s `new` and publish commands, with CSON configuration files (`draft_post.cson` and `publish_post.cson`) that specify metadata like layout, status, and output directories. The publish template dynamically computes the current date to set the post’s `date` field and target folder, while the draft template defaults to a `draft` status and `src/drafts/` output.

AI-generated description

Drafting and publishing a blog post (in docpad) using frontman

Create a new blog post:

$  frontman new.html.md -t src/templates/draft_post.cson -o .
info:    Writing  [...]\src\drafts\new.html.md
It's saved!

Publishing blog post:

$ frontman  src/drafts/new.html.md -t src/templates/publish_post.cson -o .
info:    Writing  [...]\src\documents\archives\2013\09\20\new.html.md
It's saved!

Similar vizzes