Skip to content

Instantly share code, notes, and snippets.

@Hypercubed
Last active March 31, 2016 01:43
Show Gist options
  • Save Hypercubed/6636741 to your computer and use it in GitHub Desktop.
Save Hypercubed/6636741 to your computer and use it in GitHub Desktop.
Drafting and publishing a blog post (in docpad) using [frontman](https://github.com/Hypercubed/frontman)

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!
{
layout: 'post'
title: @document.__basename
post_name: @document.__basename
status: 'draft'
tags: [ 'post' ]
__content: "Your content here"
__outputdir: "src/drafts/"
}
date = new Date()
dd = date.getDate()
dd = ('0' + dd) if (dd <= 9)
mm = date.getMonth() + 1
mm = ('0' + mm) if (mm<=9)
yyyy = date.getFullYear();
{
status: "publish"
date: yyyy+"-"+mm+"-"+dd
__outputdir: "src/documents/archives/"+yyyy+"/"+mm+"/"+dd
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment