diff options
Diffstat (limited to 'site')
| -rw-r--r-- | site/index.js | 57 | ||||
| -rw-r--r-- | site/public/css/main.css | 18 | ||||
| -rw-r--r-- | site/public/images/brown046.jpg | bin | 0 -> 5108 bytes | |||
| -rw-r--r-- | site/templates/bread.liquid | 14 | ||||
| -rw-r--r-- | site/templates/index.liquid | 30 | ||||
| -rw-r--r-- | site/templates/page.liquid | 14 |
6 files changed, 133 insertions, 0 deletions
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 Binary files differnew file mode 100644 index 0000000..4b86003 --- /dev/null +++ b/site/public/images/brown046.jpg 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> |
