Jade templating in Meteor

We would love to see Jade integration. Use packages/handlebars as a template. The basic strategy is to wire the output of the template engine into Meteor.ui.render which is how we implement live page updates. As long as your template returns HTML, that’ll work. Any time a Jade template references a Meteor.Collection document or Session variable, … Read more

How do I display todays date in Node.js Jade?

You can use moment.js First, add moment to your express application locals express = require(‘express’); … app = express(); app.locals.moment = require(‘moment’); Then you can use moment within a jade template like this: p #{moment(Date.now()).format(‘MM/DD/YYYY’)} Moment takes Date.now() by default, so yo can also write: p #{moment().format(‘MM/DD/YYYY’)} Sources: Making use of utility libraries in server-side … Read more

socket.io – can’t get it to work, having 404’s on some kind of polling call

It looks like Socket.IO can’t intercept requests starting with /socket.io/. This is because in your case the listener is app — an Express handler. You have to make http be listener, so that Socket.IO will have access to request handling. Try to replace app.set( “ipaddr”, “127.0.0.1” ); app.set( “port”, 8080 ); with http.listen(8080, “127.0.0.1”); See … Read more

Multiple Lines for Long Attribute Value in Jade / Pug

I have this same problem but in a knockoutjs context. I used the backslash like so. Previously: div(data-bind=”template: {name: ‘ingredient-template’, data: $data}”) Now: div(data-bind=”template: {\ name: ‘ingredient-template’,\ data: $data}”) Note: The backslash must be followed immediately by a newline. I’m not sure if this is the ‘official’ way, I just did it and it seems … Read more

Use a variable in a Jade include

AFAIK JADE does not support dynamic including. What I suggest is to “include” outside the template, i.e. app.js app.get(‘/admin’, function (req, res) { var Admin = require(‘./routes/admin/app’).Admin; var page=”admin”; var templates = page + ‘/templates/’; // render template and store the result in html variable res.render(templates, function(err, html) { res.render(Admin.view, { title: ‘Admin’, page: page, … Read more

CSS how to make scrollable list

As per your question vertical listing have a scrollbar effect. CSS / HTML : nav ul{height:200px; width:18%;} nav ul{overflow:hidden; overflow-y:scroll;} <!DOCTYPE html> <html> <head> <meta charset=”utf-8″> <title>JS Bin</title> </head> <body> <header>header area</header> <nav> <ul> <li>Link 1</li> <li>Link 2</li> <li>Link 3</li> <li>Link 4</li> <li>Link 5</li> <li>Link 6</li> <li>Link 7</li> <li>Link 8</li> <li>Link 9</li> <li>Link 10</li> <li>Link … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)