Simple view engine for Express
(GOAT == 'Greatest of All Time') ? 'No..'
for a quick example..
We were feeding goats at the petting zoo, and I thought about feeding data to an HTML template.
First of all, some reasons why another view/templating engine was worth a short time to put together.
Frankly, it gets no more straight-forward than,
Hello , how are you..
I don't use because unlike some people I don't like to type
NO template engine to reference or load, by the way..
Templating is just that, except usually with a strange new syntax to learn.
(The quality of which is entirely subjective by the way..)
Jade is good. Very nice. Terse == lovely. I wasn't crazy about having to
learn it (Markdown either, as you can tell by the (!lovelyness) of my README),
After some practice I can sort-of get stuff done. BUT I use two environments, Nodejs and PHP v5.2.
Jade for PHP v5.3> only, so says Mr. Google. :( I'm not upgrading my PHP right now.
Need something more old-school compatible.
Templates for every template engine I could find are not valid HTML. (Except Plates I believe)
Something just icky about that. I want to match on Div ids ala Plates. Small modules - not many features == good.
Logic, programming constructs in the template, wrong in both the academic and real worlds.
Custom syntaxes == more stuff to learn.
var express = require'express'app = express;appset'views' __dirname;appengine'html' require'goat-node';appset'view engine' 'html';appall'/index.html'// the template handles values and arrays only.. otherwise I gotta work thru dinnertime..resrender'index' name:'Goat' people:name:'chris' age:42 name:'paris' age:32var port = processenvPORT || 3000;applistenportconsole.log"Listening on " + port;
Should result in..
That's what I want.. and according to my wholly inadequate testing, that's what I now have..