# view && template
## 設置
~~~
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
~~~
## jade
jade學習
* [http://jade-lang.com/reference/](http://jade-lang.com/reference/)
* [https://github.com/i5ting/study-jade](https://github.com/i5ting/study-jade)
html轉jade是比較省力的一種方法
使用場景:尤其是寫bootstrap的時候,當然靜態頁面轉jade也一樣
hade是一個html2jade.org的copy,平常打開這個網站比較慢,索性還是在本地弄一個,用的時候一條命令打開
~~~
[sudo] npm install -g hade
hade
~~~

好處
* html和jade互轉
* 對于學習jade是比較好的練習
詳見[https://github.com/i5ting/hade](https://github.com/i5ting/hade)
## more
Template engine consolidation library for node.js
[https://github.com/tj/consolidate.js](https://github.com/tj/consolidate.js)
## Supported template engines
* [atpl](https://github.com/soywiz/atpl.js)
* [doT.js](https://github.com/olado/doT)?[(website)](http://olado.github.io/doT/)
* [dust (unmaintained)](https://github.com/akdubya/dustjs)?[(website)](http://akdubya.github.com/dustjs/)
* [dustjs-linkedin (maintained fork of dust)](https://github.com/linkedin/dustjs)?[(website)](http://linkedin.github.io/dustjs/)
* [eco](https://github.com/sstephenson/eco)
* [ect](https://github.com/baryshev/ect)?[(website)](http://ectjs.com/)
* [ejs](https://github.com/visionmedia/ejs)
* [haml](https://github.com/visionmedia/haml.js)?[(website)](http://haml-lang.com/)
* [haml-coffee](https://github.com/9elements/haml-coffee)?[(website)](http://haml-lang.com/)
* [hamlet](https://github.com/gregwebs/hamlet.js)
* [handlebars](https://github.com/wycats/handlebars.js/)?[(website)](http://handlebarsjs.com/)
* [hogan](https://github.com/twitter/hogan.js)?[(website)](http://twitter.github.com/hogan.js/)
* [htmling](https://github.com/codemix/htmling)
* [jade](https://github.com/visionmedia/jade)?[(website)](http://jade-lang.com/)
* [jazz](https://github.com/shinetech/jazz)
* [jqtpl](https://github.com/kof/node-jqtpl)?[(website)](http://api.jquery.com/category/plugins/templates/)
* [JUST](https://github.com/baryshev/just)
* [liquor](https://github.com/chjj/liquor)
* [lodash](https://github.com/bestiejs/lodash)?[(website)](http://lodash.com/)
* [mote](https://github.com/satchmorun/mote)?[(website)](http://satchmorun.github.io/mote/)
* [mustache](https://github.com/janl/mustache.js)
* [nunjucks](https://github.com/mozilla/nunjucks)?[(website)](https://mozilla.github.io/nunjucks)
* [QEJS](https://github.com/jepso/QEJS)
* [ractive](https://github.com/Rich-Harris/Ractive)
* [react](https://github.com/facebook/react)
* [swig](https://github.com/paularmstrong/swig)?[(website)](http://paularmstrong.github.com/swig/)
* [templayed](http://archan937.github.com/templayed.js/)
* [liquid](https://github.com/leizongmin/tinyliquid)?[(website)](http://liquidmarkup.org/)
* [toffee](https://github.com/malgorithms/toffee)
* [underscore](https://github.com/documentcloud/underscore)?[(website)](http://documentcloud.github.com/underscore/)
* [walrus](https://github.com/jeremyruppel/walrus)?[(website)](http://documentup.com/jeremyruppel/walrus/)
* [whiskers](https://github.com/gsf/whiskers.js)
- 前言
- 1 skill
- 1.1 Coding WebIDE
- 1.2 git
- 1.3 extra practice
- 1.4 預習
- 2 nodejs入門
- 2.1 入門
- 2.2 安裝
- 2.3 helloworld
- 2.4 commonJS規范
- 2.5 模塊導出
- 2.6 Nodejs代碼調試
- 2.7 編寫Nodejs模塊
- 2.8 最小化問題
- 2.9 隨堂練習
- 3 異步流程控制
- 3.1 什么時候會用到異步流程控制
- 3.2 簡單做法async模塊
- 3.3 Promise/a+規范
- 3.4 Node.js Promise/a+實現
- 3.5 生成器Generators/yield
- 3.6 Async函數/Await
- 3.7 神奇的co
- 3.8 5種 yieldable
- 3.9 學習重點
- 3.10 隨堂練習
- 4 express和微信開發入門
- 4.1 入門
- 4.2 connect
- 4.3 靜態Http服務器
- 4.4 那些預處理器
- 4.5 路由
- 4.6 視圖與模塊引擎
- 4.7 中間件
- 4.8 更多實踐
- 4.9 微信入門
- 4.10 隨堂練習:完成登錄、注冊功能
- 5 微信實例與H5實踐
- 5.1 微信基礎和sandbox
- 5.2 公眾號菜單和自動回復
- 5.3 微信OAuth用戶授權
- 5.4 微信分享
- 5.5 wechat-api
- 5.6 H5-上篇
- 5.7 H5-下篇
- 5.8 隨堂練習
- 6 weui實戰
- 6.1 使用bower
- 6.2 移動端抽象
- 6.3 優化滑動列表
- 6.4 weui
- 6.5 讓weui和iscroll結婚
- 6.6 優化事件
- 6.7 how-to-write-h5
- 6.8 優化無止境
- 6.9 隨堂練習
- 7 微信支付
- 7.1 吹個牛
- 7.2 支付概述
- 7.3 科普幾個概念
- 7.4 準備
- 7.5 調試
- 7.6 公眾號支付(JSAPI)
- 7.7 對賬單
- 7.8 數據處理
- 7.9 隨堂練習
- 8 項目實戰《付費課程系統MVP》
- 8.1 需求分析
- 8.2 ui/ue
- 8.3 技術棧
- 8.4 模型
- 8.5 靜態api
- 8.6 開發
- 8.7 部署
- 8.8 監控
- 8.9 數據統計
- 8.10 demo
- 9 高級篇
- 9.1 前后端分離實踐?
- 9.2 如何展望未來的大前端
- 9.3 容器和微服務
- 10 答疑問題收集