diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..677c465 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.bundle diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..824e1ca --- /dev/null +++ b/Gemfile @@ -0,0 +1,8 @@ +source 'https://rubygems.org' + +ruby '2.1.0' +#ruby-gemset=wtfismyopendatastrategy + +gem 'rack' +gem 'thin' +gem 'rake' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..764f518 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,19 @@ +GEM + remote: https://rubygems.org/ + specs: + daemons (1.1.9) + eventmachine (1.0.3) + rack (1.5.2) + rake (10.2.1) + thin (1.6.2) + daemons (>= 1.0.9) + eventmachine (>= 1.0.0) + rack (>= 1.0.0) + +PLATFORMS + ruby + +DEPENDENCIES + rack + rake + thin diff --git a/README.md b/README.md index d867c71..c79e8aa 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Inspired by [WhatTheFuckShouldIMakeForDinner.com](http://whatthefuckshouldimakef It's very simple to use and now allows you to populate it using either vanilla JavaScript objects, JSON files or direct feeds from Google spreadsheets. +This fork is designed to deploy very easily onto Heroku, see below. + ## How to use it To make your own, simply [clone](github-mac://openRepo/https://github.com/soulwire/WTFEngine) or [download](https://github.com/soulwire/WTFEngine/archive/master.zip) this repository and start populating the engine with your content. @@ -34,6 +36,17 @@ For example, here is a basic corpus As you can see, in a template you use the __@__ symbol, followed by the type of word you wish to use to tell the WTF Engine to pick a random word of that type from the corpus and insert it at that point. +## Deploying it + +This fork is designed to deploy directly onto Heroku. It _should_ be as simple as + +* Create (or more likely copy) the Google spreadsheet +* Put the spreadsheet ID into _public/scripts/main.js_ +* Commit the changes +* `heroku apps:create --region eu` +* `git push heroku master` +* `heroku open` + ## Showcase I've been pleasantly surprised to find several people using this template to create their own sites. Among them are: diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..28cf8ac --- /dev/null +++ b/config.ru @@ -0,0 +1,14 @@ +use Rack::Static, + :urls => ['/styles', '/scripts'], + :root => 'public' + +run lambda { |env| + [ + 200, + { + 'Content-Type' => 'text/html', + 'Cache-Control' => 'public, max-age=86400' + }, + File.open('public/index.html', File::RDONLY) + ] +} diff --git a/images/favicon.ico b/public/images/favicon.ico similarity index 100% rename from images/favicon.ico rename to public/images/favicon.ico diff --git a/images/favicon.png b/public/images/favicon.png similarity index 100% rename from images/favicon.png rename to public/images/favicon.png diff --git a/images/loading.gif b/public/images/loading.gif similarity index 100% rename from images/loading.gif rename to public/images/loading.gif diff --git a/index.html b/public/index.html similarity index 100% rename from index.html rename to public/index.html diff --git a/sample.json b/public/sample.json similarity index 100% rename from sample.json rename to public/sample.json diff --git a/scripts/main.js b/public/scripts/main.js similarity index 93% rename from scripts/main.js rename to public/scripts/main.js index 87c4d3f..c5f1d29 100644 --- a/scripts/main.js +++ b/public/scripts/main.js @@ -36,6 +36,6 @@ $(function() { // Populate using a Google spreadsheet ID (you must publish it first!) // @see https://support.google.com/drive/answer/37579?hl=en - WTF.init( '0AvG1Hx204EyydF9ub1M2cVJ3Z1VGdDhTSWg0ZV9LNGc' ); + WTF.init( '0AvyECrEnW-a1dHp5TFg4T1RielRfZ1lSTDhWOFhlM0E' ); -}); \ No newline at end of file +}); diff --git a/scripts/vendor/zepto.min.js b/public/scripts/vendor/zepto.min.js similarity index 100% rename from scripts/vendor/zepto.min.js rename to public/scripts/vendor/zepto.min.js diff --git a/scripts/wtf.js b/public/scripts/wtf.js similarity index 100% rename from scripts/wtf.js rename to public/scripts/wtf.js diff --git a/styles/main.css b/public/styles/main.css similarity index 99% rename from styles/main.css rename to public/styles/main.css index 36f9e13..8107e00 100644 --- a/styles/main.css +++ b/public/styles/main.css @@ -117,4 +117,4 @@ footer a { footer a:hover { text-decoration: underline; -} \ No newline at end of file +}