summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Gruntfile.js92
-rw-r--r--package.json7
-rw-r--r--site/index.js57
-rw-r--r--site/public/css/main.css18
-rw-r--r--site/public/images/brown046.jpgbin0 -> 5108 bytes
-rw-r--r--site/templates/bread.liquid14
-rw-r--r--site/templates/index.liquid30
-rw-r--r--site/templates/page.liquid14
8 files changed, 232 insertions, 0 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 0000000..73fb8f7
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,92 @@
+module.exports = function(grunt) {
+
+ // Project configuration.
+ grunt.initConfig({
+ pkg: grunt.file.readJSON('package.json'),
+ dentist: {
+ options: {
+ include_js: "assets/javascripts/app.min.js",
+ include_css: "assets/stylesheets/css.css"
+ },
+ build: {
+ src: 'index.html',
+ dest_js: 'tmp/null',
+ dest_css: 'tmp/null',
+ dest_html: 'dist/index.html'
+ }
+ },
+ concat: {
+ index: {
+ options: {
+ separator: "\n;\n"
+ },
+ src: [
+ "assets/javascripts/vendor/loader.js",
+ "assets/javascripts/vendor/froogaloop.js",
+ "assets/javascripts/vendor/flickity.pkgd.js",
+ "assets/javascripts/vendor/wheel.js",
+ "assets/javascripts/vendor/polyfill.js",
+ "assets/javascripts/vendor/util.js",
+
+ "assets/javascripts/mx/mx.skew.js",
+ "assets/javascripts/mx/extensions/mx.scene.js",
+ "assets/javascripts/mx/extensions/mx.unclampedOrbitCamera.js",
+ "assets/javascripts/mx/primitives/mx.image.js",
+ "assets/javascripts/environments/app.js",
+ "assets/javascripts/environments/path.js",
+
+ "assets/javascripts/_env.js",
+
+ "assets/javascripts/app.js",
+ ],
+ dest: 'dist/app.concat.js',
+ },
+ },
+
+ uglify: {
+ options: {
+ banner: '/* okfoc.us 2o15 */\n'
+ },
+ index: {
+ src: 'dist/app.concat.js',
+ dest: 'dist/assets/javascripts/app.min.js'
+ }
+ },
+
+ clean: {
+ release: [
+ "dist/app.concat.js",
+ "dist/app.init.js",
+ "tmp/"
+ ],
+ },
+
+ copy: {
+ build: {
+ files: [
+ {
+ nonull: true,
+ expand: true,
+ src: [
+ 'assets/stylesheets/css.css',
+ 'favicon.ico',
+ 'icon.jpg',
+ 'icon2.jpg',
+ ],
+ dest: "dist/"
+ },
+ ]
+ },
+ }
+ });
+
+ // Load tasks that we'll be using
+ grunt.loadNpmTasks('grunt-contrib-concat');
+ grunt.loadNpmTasks('grunt-contrib-uglify');
+ grunt.loadNpmTasks('grunt-contrib-clean');
+ grunt.loadNpmTasks('grunt-contrib-copy');
+ grunt.loadNpmTasks('grunt-dentist');
+
+ // Default task(s).
+ grunt.registerTask('default', ['dentist', 'concat', 'uglify', 'copy', 'clean']);
+};
diff --git a/package.json b/package.json
index c837051..1358023 100644
--- a/package.json
+++ b/package.json
@@ -11,6 +11,13 @@
"dependencies": {
"dotenv": "^1.1.0",
"express": "^4.12.3",
+ "grunt": "^0.4.5",
+ "grunt-cli": "^0.1.13",
+ "grunt-contrib-clean": "^0.6.0",
+ "grunt-contrib-concat": "^0.5.1",
+ "grunt-contrib-copy": "^0.8.0",
+ "grunt-contrib-uglify": "^0.9.1",
+ "grunt-dentist": "^0.3.4",
"object-assign": "^2.0.0",
"q": "^1.2.0"
}
diff --git a/site/index.js b/site/index.js
new file mode 100644
index 0000000..95d2bcf
--- /dev/null
+++ b/site/index.js
@@ -0,0 +1,57 @@
+var okcms = require('..');
+
+var app = okcms.createApp({
+
+ root: 'public',
+
+ schemas: {
+ page: {
+ id: {type: 'string'},
+ title: {type: 'string'},
+ body: {type: 'text'}
+ },
+ bread: {
+ type: {type: 'string', id: true},
+ title: {type: 'string'},
+ description: {type: 'text'},
+ color: {type: 'enum', options: ["red","blue","green"]},
+ video: {type: 'video'},
+ images: {type: 'captioned-image-list'}
+ }
+ },
+
+ resources: [
+ { type: 'page', static: {id: 'about'}},
+ { type: 'page', static: {id: 'contact'}},
+ { type: 'bread' },
+ ],
+
+ services: {
+ s3: {
+ key: process.env.S3_KEY,
+ secret: process.env.S3_SECRET,
+ bucket: process.env.S3_BUCKET,
+ }
+ },
+
+ views: {
+ '/': {
+ data: [
+ {type: 'bread', query: '*'},
+ {type: 'page', query: '*'}
+ ]
+ },
+ '/about': {
+ data: {type: 'page', query: 'about'}
+ },
+ '/contact': {
+ data: {type: 'page', query: 'contact'}
+ },
+ '/:id': {
+ data: {type: 'bread', query: ':id'}
+ }
+ }
+
+}).listen(1337);
+
+console.log('Server listening at port 1337...');
diff --git a/site/public/css/main.css b/site/public/css/main.css
new file mode 100644
index 0000000..92b2ee7
--- /dev/null
+++ b/site/public/css/main.css
@@ -0,0 +1,18 @@
+html, body {
+ margin: 0;
+ passing: 0;
+ font-family: "Georgia", sans-serif;
+}
+
+body {
+ background-image: url(../images/brown046.jpg);
+}
+
+h1, h2, h3 {
+ color: rgb(12, 145, 14);
+}
+
+.container {
+ padding: 2em;
+ background-color: rgba(255, 255, 255, 0.5);
+}
diff --git a/site/public/images/brown046.jpg b/site/public/images/brown046.jpg
new file mode 100644
index 0000000..4b86003
--- /dev/null
+++ b/site/public/images/brown046.jpg
Binary files differ
diff --git a/site/templates/bread.liquid b/site/templates/bread.liquid
new file mode 100644
index 0000000..da36cce
--- /dev/null
+++ b/site/templates/bread.liquid
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <link rel="stylesheet" href="../css/main.css">
+ </head>
+ <body>
+ <div class="container">
+ <h1>{{bread.type | capitalize}}</h1>
+ <p>
+ {{bread.description}}
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/site/templates/index.liquid b/site/templates/index.liquid
new file mode 100644
index 0000000..7c12a86
--- /dev/null
+++ b/site/templates/index.liquid
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <link rel="stylesheet" href="css/main.css">
+ </head>
+ <body>
+ <div class="container">
+ <header>
+ <h1>Cheryl's Deli and Bakery</h1>
+ </header>
+ <section class="main">
+ <nav>
+ <ul>
+ {% for page in pages %}
+ <li><a href="{{page.id}}">{{page.id | capitalize}}</a></li>
+ {% endfor %}
+ </ul>
+ <nav>
+ <div class="breads">
+ <h2>Great breads:</h2>
+ <ul>
+ {% for bread in breads %}
+ <li><a href="{{bread.id}}">{{bread.id | capitalize}}</a></li>
+ {% endfor %}
+ </ul>
+ </div>
+ </section>
+ </div>
+ </body>
+</html>
diff --git a/site/templates/page.liquid b/site/templates/page.liquid
new file mode 100644
index 0000000..e90f7ce
--- /dev/null
+++ b/site/templates/page.liquid
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <link rel="stylesheet" href="../css/main.css">
+ </head>
+ <body>
+ <div class="container">
+ <h1>{{page.title | capitalize}}</h1>
+ <p>
+ {{page.body}}
+ </p>
+ </div>
+ </body>
+</html>