Skip to content

Instantly share code, notes, and snippets.

@Christo44
Christo44 / Pug.object.pug
Created September 16, 2016 14:31
Object traversal in Pug (fna Jade)
- var floors = { ground: { name: "Ground Floor", image: "ground.png", tenants: { t1: { image: false, heading: '4 desks available', description: 'Lorem ipsum dolor sit amet,consectetur adipisicing elit', linkDescription: 'Link to sales page', linkTarget: 'http://www.google.com', posx: '120', posy: '330' }, t2: { image: 'avaaz.png', heading: 'Company name', description: 'Lorem ipsum dolor sit amet,consectetur adipisicing elit', linkDescription: 'External link', linkTarget: 'http://www.google.com', posx: '340', posy: '280' } } }, first: { name: "1st Floor", image: "ground.png", tenants: { t1: { image: false, heading: '4 desks available', description: 'Lorem ipsum dolor sit amet,consectetur adipisicing elit', linkDescription: 'Link to sales page', linkTarget: 'http://www.google.com', posx: '120', posy: '330' }, t2: { image: 'avaaz.png', heading: 'Company name', description: 'Lorem ipsum dolor sit amet,consectetur adipisicing elit', linkDescription: 'External link', linkTarget: 'http://www.google.com', posx: '340'
@Christo44
Christo44 / booklist
Created September 7, 2016 15:17
Create list if specific values are present, & omit empty values
-var books= {"books": [""]}
mixin component(name, books)
for book in books
case book
when "l"
-var p= "large"
when "m"
-var p= "medium"
when "s"