summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryo mama <pepper@scannerjammer.com>2014-12-05 19:17:43 -0800
committeryo mama <pepper@scannerjammer.com>2014-12-05 19:17:43 -0800
commite387304922f6379cebebaaa511c608855d8acba1 (patch)
tree80b1e72d70ca2fd09b8dad239fbdb994f440cc64
parent802bbc5a0e49a627ab8001d5b30509688959f06b (diff)
added branch ejsejs
-rwxr-xr-xbin/app.js4
-rwxr-xr-xcontrollers/index.js2
-rw-r--r--package.json1
-rw-r--r--views/main.ejs3
-rw-r--r--views/partials/bottom.ejs2
-rw-r--r--views/partials/icons.ejs4
-rw-r--r--views/partials/meta.ejs16
-rw-r--r--views/partials/stylesheets.ejs4
-rw-r--r--views/partials/top.ejs16
9 files changed, 49 insertions, 3 deletions
diff --git a/bin/app.js b/bin/app.js
index 842707f..1d4ca61 100755
--- a/bin/app.js
+++ b/bin/app.js
@@ -21,8 +21,8 @@ app.use(express.static('../public/vendor'));
//app.use(express.favicon(__dirname + '/public/images/shortcut-icon.png'));
//app.use(messages());
-app.set('view engine', 'html');
-app.set('views', __dirname + '/views');
+app.set('view engine', 'ejs');
+app.set('views', 'views');
// view caching
app.set('view cache', false);
diff --git a/controllers/index.js b/controllers/index.js
index 71ca5d4..9bb524a 100755
--- a/controllers/index.js
+++ b/controllers/index.js
@@ -1,4 +1,4 @@
var rendering = require('../config/rendering');
exports.main = function(req, res) {
- res.json('hello world');
+ res.render('main', { foo: 'bar' });
}
diff --git a/package.json b/package.json
index cd5298c..804cec6 100644
--- a/package.json
+++ b/package.json
@@ -17,6 +17,7 @@
"body-parser": "^1.10.0",
"cookie-parser": "^1.3.3",
"cookie-session": "^1.1.0",
+ "ejs": "^1.0.0",
"express": "^4.10.4",
"express-validator": "^2.7.0",
"fs-extra": "^0.12.0",
diff --git a/views/main.ejs b/views/main.ejs
new file mode 100644
index 0000000..c5f2d04
--- /dev/null
+++ b/views/main.ejs
@@ -0,0 +1,3 @@
+<% include partials/top %>
+YOO BOII!
+<% include partials/bottom %>
diff --git a/views/partials/bottom.ejs b/views/partials/bottom.ejs
new file mode 100644
index 0000000..308b1d0
--- /dev/null
+++ b/views/partials/bottom.ejs
@@ -0,0 +1,2 @@
+</body>
+</html>
diff --git a/views/partials/icons.ejs b/views/partials/icons.ejs
new file mode 100644
index 0000000..c8e72f9
--- /dev/null
+++ b/views/partials/icons.ejs
@@ -0,0 +1,4 @@
+ <link rel="image_src" href=""/>
+ <link rel="shortcut icon" href="/favicon.ico"/>
+ <link rel="apple-touch-icon" href="" />
+ <link rel="apple-touch-icon-precomposed" href="" />
diff --git a/views/partials/meta.ejs b/views/partials/meta.ejs
new file mode 100644
index 0000000..f4d29d9
--- /dev/null
+++ b/views/partials/meta.ejs
@@ -0,0 +1,16 @@
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
+ <meta name="apple-mobile-web-app-status-bar-style" content="black">
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
+ <meta name="description" content="" />
+ <meta property="og:title" content=""/>
+ <meta property="og:type" content="website"/>
+ <meta property="og:image" content="http://"/>
+ <meta property="og:url" content="http://"/>
+ <meta property="og:description" content="" />
+ <meta property="og:site_name" content="" />
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
diff --git a/views/partials/stylesheets.ejs b/views/partials/stylesheets.ejs
new file mode 100644
index 0000000..9b51d2f
--- /dev/null
+++ b/views/partials/stylesheets.ejs
@@ -0,0 +1,4 @@
+ <link rel="stylesheet" type="text/css" href="css/animate.css">
+ <link rel="stylesheet" type="text/css" href="css/colors.css">
+ <link rel="stylesheet" type="text/css" href="css/unsemantic-grid-responsive-tablet.css">
+ <link rel="stylesheet" type="text/css" href="css/site.css">
diff --git a/views/partials/top.ejs b/views/partials/top.ejs
new file mode 100644
index 0000000..8e3ef5e
--- /dev/null
+++ b/views/partials/top.ejs
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+ <title>
+ <% if(typeof(name) !== 'undefined'){ %>
+ <%= name %>
+ <%} %>
+ <% if(typeof(description) !== 'undefined'){ %>
+ <%= description %>
+ <%} %>
+ </title>
+<% include meta %>
+<% include icons %>
+<% include stylesheets %>
+</head>
+<body>