diff --git a/app.js b/app.js index 84ef9c2..ccafc2f 100644 --- a/app.js +++ b/app.js @@ -16,6 +16,8 @@ app.configure(function(){ app.use(app.router); app.use(express.static(path.join(__dirname,'./public'))); app.set('port', process.env.PORT || 3000); + app.set('view engine','jade'); + app.set('views',__dirname+'/public/layouts'); }); // Routes diff --git a/node_modules/.bin/jade b/node_modules/.bin/jade new file mode 120000 index 0000000..65a3bac --- /dev/null +++ b/node_modules/.bin/jade @@ -0,0 +1 @@ +../jade/bin/jade.js \ No newline at end of file diff --git a/node_modules/jade/.npmignore b/node_modules/jade/.npmignore new file mode 100644 index 0000000..fdc7b89 --- /dev/null +++ b/node_modules/jade/.npmignore @@ -0,0 +1,14 @@ +test +support +benchmarks +examples +lib-cov +coverage.html +.gitmodules +.travis.yml +History.md +Makefile +test/ +support/ +benchmarks/ +examples/ diff --git a/node_modules/jade/LICENSE b/node_modules/jade/LICENSE new file mode 100644 index 0000000..8ad0e0d --- /dev/null +++ b/node_modules/jade/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2009-2010 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/jade/README.md b/node_modules/jade/README.md new file mode 100644 index 0000000..2b6de93 --- /dev/null +++ b/node_modules/jade/README.md @@ -0,0 +1,161 @@ +# [![Jade - template engine ](http://i.imgur.com/5zf2aVt.png)](http://jade-lang.com/) + +Full documentation is at [jade-lang.com](http://jade-lang.com/) + + Jade is a high performance template engine heavily influenced by [Haml](http://haml-lang.com) + and implemented with JavaScript for [node](http://nodejs.org). For discussion join the [Google Group](http://groups.google.com/group/jadejs). + + You can test drive Jade online [here](http://naltatis.github.com/jade-syntax-docs). + + [![Build Status](https://travis-ci.org/visionmedia/jade.png?branch=master)](https://travis-ci.org/visionmedia/jade) + [![Dependency Status](https://gemnasium.com/visionmedia/jade.png)](https://gemnasium.com/visionmedia/jade) + [![NPM version](https://badge.fury.io/js/jade.png)](http://badge.fury.io/js/jade) + +## Announcements + +**Deprecation of implicit script/style text-only:** + + Jade version 0.31.0 deprecated implicit text only support for scripts and styles. To fix this all you need to do is add a `.` character after the script or style tag. + + It is hoped that this change will make Jade easier for newcomers to learn without affecting the power of the language or leading to excessive verboseness. + + If you have a lot of Jade files that need fixing you can use [fix-jade](https://github.com/ForbesLindesay/fix-jade) to attempt to automate the process. + +**Command line option change:** + +since `v0.31.0`, `-o` is preferred for `--out` where we used `-O` before. + +## Installation + +via npm: + +```bash +$ npm install jade +``` + +## Syntax + +Jade is a clean, whitespace sensitive syntax for writing html. Here is a simple example: + +```jade +doctype html +html(lang="en") + head + title= pageTitle + script(type='text/javascript'). + if (foo) bar(1 + 5) + body + h1 Jade - node template engine + #container.col + if youAreUsingJade + p You are amazing + else + p Get on it! + p. + Jade is a terse and simple templating language with a + strong focus on performance and powerful features. +``` + +becomes + + +```html + + + + Jade + + + +

Jade - node template engine

+
+

You are amazing

+

Jade is a terse and simple templating language with a strong focus on performance and powerful features.

+
+ + +``` + +The official [jade tutorial](http://jade-lang.com/tutorial/) is a great place to start. While that (and the syntax documentation) is being finished, you can view some of the old documentation [here](https://github.com/visionmedia/jade/blob/master/jade.md) and [here](https://github.com/visionmedia/jade/blob/master/jade-language.md) + +## API + +For full API, see [jade-lang.com/api](http://jade-lang.com/api/) + +```js +var jade = require('jade'); + +// compile +var fn = jade.compile('string of jade', options); +var html = fn(locals); + +// render +var html = jade.render('string of jade', merge(options, locals)); + +// renderFile +var html = jade.renderFile('filename.jade', merge(options, locals)); +``` + +### Options + + - `filename` Used in exceptions, and required when using includes + - `compileDebug` When `false` no debug instrumentation is compiled + - `pretty` Add pretty-indentation whitespace to output _(false by default)_ + +## Browser Support + + The latest version of jade can be download for the browser in standalone form from [here](https://github.com/visionmedia/jade/raw/master/jade.js). It only supports the very latest browsers though, and is a large file. It is recommended that you pre-compile your jade templates to JavaScript and then just use the [runtime.js](https://github.com/visionmedia/jade/raw/master/runtime.js) library on the client. + + To compile a template for use on the client using the command line, do: + +```console +$ jade --client --no-debug filename.jade +``` + +which will produce `filename.js` containing the compiled template. + +## Command Line + +After installing the latest version of [node](http://nodejs.org/), install with: + +```console +$ npm install jade -g +``` + +and run with + +```console +$ jade --help +``` + +## Additional Resources + +Tutorials: + + - cssdeck interactive [Jade syntax tutorial](http://cssdeck.com/labs/learning-the-jade-templating-engine-syntax) + - cssdeck interactive [Jade logic tutorial](http://cssdeck.com/labs/jade-templating-tutorial-codecast-part-2) + - in [Japanese](http://blog.craftgear.net/4f501e97c1347ec934000001/title/10%E5%88%86%E3%81%A7%E3%82%8F%E3%81%8B%E3%82%8Bjade%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88%E3%82%A8%E3%83%B3%E3%82%B8%E3%83%B3) + + +Implementations in other languages: + + - [php](http://github.com/everzet/jade.php) + - [scala](http://scalate.fusesource.org/versions/snapshot/documentation/scaml-reference.html) + - [ruby](https://github.com/slim-template/slim) + - [python](https://github.com/SyrusAkbary/pyjade) + - [java](https://github.com/neuland/jade4j) + +Other: + + - [Emacs Mode](https://github.com/brianc/jade-mode) + - [Vim Syntax](https://github.com/digitaltoad/vim-jade) + - [TextMate Bundle](http://github.com/miksago/jade-tmbundle) + - [Coda/SubEtha syntax Mode](https://github.com/aaronmccall/jade.mode) + - [Screencasts](http://tjholowaychuk.com/post/1004255394/jade-screencast-template-engine-for-nodejs) + - [html2jade](https://github.com/donpark/html2jade) converter + +## License + +MIT diff --git a/node_modules/jade/Readme_zh-cn.md b/node_modules/jade/Readme_zh-cn.md new file mode 100644 index 0000000..160ea0e --- /dev/null +++ b/node_modules/jade/Readme_zh-cn.md @@ -0,0 +1,1285 @@ +# Jade - 模板引擎 + +Jade 是一个高性能的模板引擎,它深受 [Haml](http://haml-lang.com) 影响,它是用 JavaScript 实现的, 并且可以供 [Node](http://nodejs.org) 使用. + +翻译: [草依山](http://jser.me) 等 + +## 声明 + +从 Jade `v0.31.0` 开始放弃了对于 `" +| !{html} +``` + +内联标签同样可以使用文本块来包含文本: + +```jade +label + | Username: + input(name='user[name]') +``` + +或者直接使用标签文本: + +```jade +label Username: + input(name='user[name]') +``` + +_只_ 包含文本的标签,比如 ` + + +

My Site

+

Welcome to my super lame site.

+ + + +``` + +前面已经提到,`include` 可以包含比如 HTML 或者 CSS 这样的内容。给定一个扩展名后,Jade 不会把这个文件当作一个 Jade 源代码,并且会把它当作一个普通文本包含进来: + +``` +html + head + //- css and js have simple filters that wrap them in +