Skip to content

Instantly share code, notes, and snippets.

@fmoliveira
Forked from nolim1t/home.jade
Last active August 29, 2015 14:11
Show Gist options
  • Save fmoliveira/a973821989bb5502e544 to your computer and use it in GitHub Desktop.
Save fmoliveira/a973821989bb5502e544 to your computer and use it in GitHub Desktop.
h2 Hello World
h3 Hello World
:markdown
This is some **test** markdown text
we can even link to [stuff](http://google.com)
ul.list
- each i in data
li=i.name
!!! 5
html
head
title= typeof(title) !== 'undefined' ? title : "Untitled template"
meta(name='keywords', content='foo bar baz')
meta(name='description', content='Description')
meta(name='og:title', content=typeof(title) !== 'undefined' ? title : "Untitled template")
link(rel='shortcut icon', href='/path/to/favicon.png', type='image/x-icon')
body
h1 #{typeof(title) !== 'undefined' ? title : "Untitled template"}
#main
!= body
# npm install express
# npm install jade
# npm install markdown-js
express = require 'express'
static = express.static __dirname + "/public"
bodyParser = express.static(__dirname + "/public")
favicon = express.favicon()
cookieParser = express.cookieParser()
app = express.createServer bodyParser, static, favicon, cookieParser
app.configure () ->
app.set 'view engine', 'jade'
app.set 'views', './views'
app.get '/', (req, res) ->
data = [{id: 1, name: "Item One"}, {id: 2, name: "Item Two"}]
res.render('home', {title: "This is a title", data: data})
app.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment