Skip to content

Instantly share code, notes, and snippets.

@ahmedelgabri
Created December 1, 2014 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmedelgabri/c22b9d7a893d87f29d25 to your computer and use it in GitHub Desktop.
Save ahmedelgabri/c22b9d7a893d87f29d25 to your computer and use it in GitHub Desktop.
Add Custom Jade tags
doctype html
html
head
title Hi
body
div
span= formatDate('Dec 25, 1995')
var j = require('jade'),
m = require('moment');
var locals = {
formatDate: function( str ) {
return m(str).format();
}
};
console.log(j.compileFile('index.jade')(locals));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment