From c5d20cbd78e4f99d3b8057c36473a73479459702 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Wed, 23 Nov 2016 18:14:01 +0000 Subject: [PATCH] First stab at turning this into a Github Pages site --- .gitignore | 5 +- 404.html | 4 + Dockerfile | 11 -- Gemfile | 3 + Gemfile.lock | 141 ++++++++++++++++++++ Makefile | 34 +---- Procfile | 1 - README.md | 3 - _config.yml | 8 ++ _includes/ga.html | 10 ++ _includes/head.html | 5 + _layouts/default.html | 8 ++ _sass/_layout.scss | 48 +++++++ _sass/_webfonts.scss | 7 + app.coffee | 34 ----- css/main.scss | 5 + {public/css => css}/style.css | 0 public/favicon.ico => favicon.ico | 0 {public/font => font}/open-sans-300.woff | Bin {public/font => font}/open-sans-400.woff | Bin {public/images => images}/404-dead-link.png | Bin {public/images => images}/heartb.it.png | Bin index.html | 7 + lib/middleware/host_redirect.coffee | 7 - package.json | 22 --- public/robots.txt => robots.txt | 0 server.coffee | 9 -- test/middleware/host_redirect.test.coffee | 28 ---- views/404.coffee | 1 - views/ga.coffee | 13 -- views/index.coffee | 5 - views/layout.coffee | 9 -- 32 files changed, 252 insertions(+), 176 deletions(-) create mode 100644 404.html delete mode 100644 Dockerfile create mode 100644 Gemfile create mode 100644 Gemfile.lock delete mode 100644 Procfile create mode 100644 _config.yml create mode 100644 _includes/ga.html create mode 100644 _includes/head.html create mode 100644 _layouts/default.html create mode 100644 _sass/_layout.scss create mode 100644 _sass/_webfonts.scss delete mode 100644 app.coffee create mode 100644 css/main.scss rename {public/css => css}/style.css (100%) rename public/favicon.ico => favicon.ico (100%) rename {public/font => font}/open-sans-300.woff (100%) rename {public/font => font}/open-sans-400.woff (100%) rename {public/images => images}/404-dead-link.png (100%) rename {public/images => images}/heartb.it.png (100%) create mode 100644 index.html delete mode 100644 lib/middleware/host_redirect.coffee delete mode 100644 package.json rename public/robots.txt => robots.txt (100%) delete mode 100644 server.coffee delete mode 100644 test/middleware/host_redirect.test.coffee delete mode 100644 views/404.coffee delete mode 100644 views/ga.coffee delete mode 100644 views/index.coffee delete mode 100644 views/layout.coffee diff --git a/.gitignore b/.gitignore index 239d103..03cd95a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ .DS_Store -node_modules -docs -*.js \ No newline at end of file +.sass-cache/* +_site/* diff --git a/404.html b/404.html new file mode 100644 index 0000000..bcd521f --- /dev/null +++ b/404.html @@ -0,0 +1,4 @@ +--- +permalink: /404.html +--- +
diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 66c3966..0000000 --- a/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM node:5.11.1 - -RUN mkdir /app -WORKDIR /app -COPY package.json /app/ -RUN npm install -COPY . /app - -ENV PORT=80 -EXPOSE $PORT -CMD ["npm", "start"] diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..24a105d --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org/' + +gem 'github-pages' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..a8c2213 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,141 @@ +GEM + remote: https://rubygems.org/ + specs: + RedCloth (4.2.9) + activesupport (5.0.0.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (~> 0.7) + minitest (~> 5.1) + tzinfo (~> 1.1) + addressable (2.4.0) + blankslate (2.1.2.4) + classifier-reborn (2.0.4) + fast-stemmer (~> 1.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.10.0) + colorator (0.1) + concurrent-ruby (1.0.2) + ethon (0.9.1) + ffi (>= 1.3.0) + execjs (2.7.0) + faraday (0.10.0) + multipart-post (>= 1.2, < 3) + fast-stemmer (1.0.2) + ffi (1.9.14) + gemoji (2.1.0) + github-pages (39) + RedCloth (= 4.2.9) + github-pages-health-check (~> 0.2) + jekyll (= 2.4.0) + jekyll-coffeescript (= 1.0.1) + jekyll-feed (= 0.3.1) + jekyll-mentions (= 0.2.1) + jekyll-redirect-from (= 0.8.0) + jekyll-sass-converter (= 1.3.0) + jekyll-sitemap (= 0.8.1) + jemoji (= 0.5.0) + kramdown (= 1.5.0) + liquid (= 2.6.2) + maruku (= 0.7.0) + mercenary (~> 0.3) + pygments.rb (= 0.6.3) + rdiscount (= 2.1.7) + redcarpet (= 3.3.2) + terminal-table (~> 1.4) + github-pages-health-check (0.3.2) + net-dns (~> 0.6) + public_suffix (~> 1.4) + typhoeus (~> 0.7) + html-pipeline (1.9.0) + activesupport (>= 2) + nokogiri (~> 1.4) + i18n (0.7.0) + jekyll (2.4.0) + classifier-reborn (~> 2.0) + colorator (~> 0.1) + jekyll-coffeescript (~> 1.0) + jekyll-gist (~> 1.0) + jekyll-paginate (~> 1.0) + jekyll-sass-converter (~> 1.0) + jekyll-watch (~> 1.1) + kramdown (~> 1.3) + liquid (~> 2.6.1) + mercenary (~> 0.3.3) + pygments.rb (~> 0.6.0) + redcarpet (~> 3.1) + safe_yaml (~> 1.0) + toml (~> 0.1.0) + jekyll-coffeescript (1.0.1) + coffee-script (~> 2.2) + jekyll-feed (0.3.1) + jekyll-gist (1.4.0) + octokit (~> 4.2) + jekyll-mentions (0.2.1) + html-pipeline (~> 1.9.0) + jekyll (~> 2.0) + jekyll-paginate (1.1.0) + jekyll-redirect-from (0.8.0) + jekyll (>= 2.0) + jekyll-sass-converter (1.3.0) + sass (~> 3.2) + jekyll-sitemap (0.8.1) + jekyll-watch (1.5.0) + listen (~> 3.0, < 3.1) + jemoji (0.5.0) + gemoji (~> 2.0) + html-pipeline (~> 1.9) + jekyll (>= 2.0) + kramdown (1.5.0) + liquid (2.6.2) + listen (3.0.8) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + maruku (0.7.0) + mercenary (0.3.6) + mini_portile2 (2.1.0) + minitest (5.9.1) + multipart-post (2.0.0) + net-dns (0.8.0) + nokogiri (1.6.8.1) + mini_portile2 (~> 2.1.0) + octokit (4.6.2) + sawyer (~> 0.8.0, >= 0.5.3) + parslet (1.5.0) + blankslate (~> 2.0) + posix-spawn (0.3.12) + public_suffix (1.5.3) + pygments.rb (0.6.3) + posix-spawn (~> 0.3.6) + yajl-ruby (~> 1.2.0) + rb-fsevent (0.9.8) + rb-inotify (0.9.7) + ffi (>= 0.5.0) + rdiscount (2.1.7) + redcarpet (3.3.2) + safe_yaml (1.0.4) + sass (3.4.22) + sawyer (0.8.1) + addressable (>= 2.3.5, < 2.6) + faraday (~> 0.8, < 1.0) + terminal-table (1.7.3) + unicode-display_width (~> 1.1.1) + thread_safe (0.3.5) + toml (0.1.2) + parslet (~> 1.5.0) + typhoeus (0.8.0) + ethon (>= 0.8.0) + tzinfo (1.2.2) + thread_safe (~> 0.1) + unicode-display_width (1.1.1) + yajl-ruby (1.2.1) + +PLATFORMS + ruby + +DEPENDENCIES + github-pages + +BUNDLED WITH + 1.13.6 diff --git a/Makefile b/Makefile index 3ed647c..75239c6 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,5 @@ +serve: + bundle exec jekyll serve + .SILENT: -.PHONY: deploy docs read-docs test build watch - -BIN = ./node_modules/.bin - -REPORTER = spec -TESTS = ./test/**/*.test.coffee -SOURCES = ./*.coffee ./lib/**/*.coffee - -default: test - -deploy: - git push heroku master - -docs: - $(BIN)/docco $(shell find $(SOURCES)) - -read-docs: - open docs/app.html - -test: - NODE_ENV=test $(BIN)/mocha \ - --compilers coffee:coffee-script \ - --reporter $(REPORTER) \ - $(shell find $(TESTS)) - -build: - $(BIN)/coffee -c $(SOURCES) - -watch: - $(BIN)/coffee -cw $(SOURCES) +.PHONY: diff --git a/Procfile b/Procfile deleted file mode 100644 index 9e9c9c3..0000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: coffee server.coffee \ No newline at end of file diff --git a/README.md b/README.md index f4cc058..a2428b5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,3 @@ # heartb.it -Build a splash-page with Node.js/CoffeeScript/Heroku? Are you mad? --Yes, but -that's besides the point. I just wanna have fun. - [http://heartb.it/](http://heartb.it/) diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..f34b1d0 --- /dev/null +++ b/_config.yml @@ -0,0 +1,8 @@ +# Site settings +title: heartb.it +baseurl: "" # the subpath of your site, e.g. /blog/ +hostname: heartb.it # used to determine if google analytics should be triggered +url: http://heartb.it # the base hostname & protocol for your site + +# Build settings +markdown: kramdown diff --git a/_includes/ga.html b/_includes/ga.html new file mode 100644 index 0000000..a894fc4 --- /dev/null +++ b/_includes/ga.html @@ -0,0 +1,10 @@ + diff --git a/_includes/head.html b/_includes/head.html new file mode 100644 index 0000000..4355611 --- /dev/null +++ b/_includes/head.html @@ -0,0 +1,5 @@ + + + {{ site.title }} + + diff --git a/_layouts/default.html b/_layouts/default.html new file mode 100644 index 0000000..59fb17f --- /dev/null +++ b/_layouts/default.html @@ -0,0 +1,8 @@ + + + {% include head.html %} + + {{ content }} + {% include ga.html %} + + diff --git a/_sass/_layout.scss b/_sass/_layout.scss new file mode 100644 index 0000000..638f3a1 --- /dev/null +++ b/_sass/_layout.scss @@ -0,0 +1,48 @@ +body { + font-family: 'Open Sans', helvetica, arial, sans-serif; + padding: 0; + margin: 0; +} + +#logo { + background: url("../images/heartb.it.png") center center no-repeat; + position: absolute; + top: 50%; + left: 50%; + margin: -18px 0px 0px -75px; + height: 37px; + width: 150px; +} + +#contact { + font-size: 12px; + font-weight: 300; + position: absolute; + right: 8px; + bottom: 5px; + + a { + color: #aaa; + text-decoration: none; + -webkit-transition-duration: 0.3s; + -webkit-transition-property: color, border; + -webkit-transition-timing-function: ease-in; + + &:hover { + color: #555; + -webkit-transition-duration: 0.3s; + -webkit-transition-property: color, border; + -webkit-transition-timing-function: ease-in; + } + } +} + +#not-found { + background: url("../images/404-dead-link.png") center center no-repeat; + position: absolute; + top: 50%; + left: 50%; + margin: -150px 0px 0px -250px; + height: 300px; + width: 500px; +} diff --git a/_sass/_webfonts.scss b/_sass/_webfonts.scss new file mode 100644 index 0000000..0ca5a62 --- /dev/null +++ b/_sass/_webfonts.scss @@ -0,0 +1,7 @@ +/* Borrowed from Google WebFonts for offline development */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 300; + src: local("Open Sans Light"), local("OpenSans-Light"), url("../font/open-sans-300.woff") format("woff"); +} diff --git a/app.coffee b/app.coffee deleted file mode 100644 index 39006cc..0000000 --- a/app.coffee +++ /dev/null @@ -1,34 +0,0 @@ -# Module Dependencies. -express = require 'express' - -# Create app instance. -app = express.createServer() - -# Export the app. -module.exports = app - -# Configuration. -app.configure -> - app.set 'views', __dirname + '/views' - app.set 'view engine', 'coffee' - app.register '.coffee', require('coffeekup').adapters.express - app.use express.bodyParser() - app.use express.methodOverride() - app.use express.static(__dirname + '/public') - -app.configure 'development', -> - app.use express.errorHandler(dumpExceptions: true, showStack: true) - -app.configure 'production', -> - app.use express.errorHandler() - app.use require('./lib/middleware/host_redirect') - "www.heartb.it": "http://heartb.it/" - - -# Routes -app.get '/', (req, res) -> - res.render 'index', format: true - -# 404 Fallback -app.get '*', (req, res) -> - res.render '404', format: true diff --git a/css/main.scss b/css/main.scss new file mode 100644 index 0000000..0b15573 --- /dev/null +++ b/css/main.scss @@ -0,0 +1,5 @@ +--- +# Only the main Sass file needs front matter (the dashes are enough) +--- + +@import "webfonts", "layout"; diff --git a/public/css/style.css b/css/style.css similarity index 100% rename from public/css/style.css rename to css/style.css diff --git a/public/favicon.ico b/favicon.ico similarity index 100% rename from public/favicon.ico rename to favicon.ico diff --git a/public/font/open-sans-300.woff b/font/open-sans-300.woff similarity index 100% rename from public/font/open-sans-300.woff rename to font/open-sans-300.woff diff --git a/public/font/open-sans-400.woff b/font/open-sans-400.woff similarity index 100% rename from public/font/open-sans-400.woff rename to font/open-sans-400.woff diff --git a/public/images/404-dead-link.png b/images/404-dead-link.png similarity index 100% rename from public/images/404-dead-link.png rename to images/404-dead-link.png diff --git a/public/images/heartb.it.png b/images/heartb.it.png similarity index 100% rename from public/images/heartb.it.png rename to images/heartb.it.png diff --git a/index.html b/index.html new file mode 100644 index 0000000..6c302ad --- /dev/null +++ b/index.html @@ -0,0 +1,7 @@ +--- +layout: default +--- + +
+ +
diff --git a/lib/middleware/host_redirect.coffee b/lib/middleware/host_redirect.coffee deleted file mode 100644 index 5ac2684..0000000 --- a/lib/middleware/host_redirect.coffee +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = (redirect_map = {}) -> - (req, res, next) -> - host = req.header('Host') - if redirect_map[host] - res.redirect(redirect_map[host]) - else - next() \ No newline at end of file diff --git a/package.json b/package.json deleted file mode 100644 index 95e7bce..0000000 --- a/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "heartb.it", - "version": "0.0.1", - "private": true, - "dependencies": { - "express": "2.5.0", - "coffee-script": "1.3.3", - "coffeekup": "0.3.1" - }, - "devDependencies": { - "docco": ">= 0.0.0", - "mocha": ">= 0.0.0", - "should": ">= 0.0.0" - }, - "scripts": { - "start": "coffee server.coffee" - }, - "engines": { - "node": "5.x.x", - "npm": "3.x.x" - } -} diff --git a/public/robots.txt b/robots.txt similarity index 100% rename from public/robots.txt rename to robots.txt diff --git a/server.coffee b/server.coffee deleted file mode 100644 index b080218..0000000 --- a/server.coffee +++ /dev/null @@ -1,9 +0,0 @@ -# Load the app -app = require './app' - -# Set port and start server. -app.listen process.env.PORT || 3000 - -# Print debug -console.log "Express app listening on port %d in %s mode", - app.address().port, app.settings.env diff --git a/test/middleware/host_redirect.test.coffee b/test/middleware/host_redirect.test.coffee deleted file mode 100644 index bb43909..0000000 --- a/test/middleware/host_redirect.test.coffee +++ /dev/null @@ -1,28 +0,0 @@ -require 'should' - -host_redirect = require '../../lib/middleware/host_redirect' - -describe 'host_redirect', -> - - redirect_map = - 'www.foo.com': 'http://foo.com/', - 'img.foo.com': 'http://images.foo.com/' - - redirector = host_redirect(redirect_map) - - describe 'when request does not match any entry in map', -> - it 'next() is called to pass on the request', (done) -> - req = header: -> 'www.bar.com' - res = {} - next = -> done() - redirector(req, res, next) - - describe 'when request matches an entry in map', -> - it 'req.redirect() is called with the new URL', (done) -> - req = header: -> 'img.foo.com' - res = - redirect: (url) -> - url.should.equal(redirect_map[req.header()]) - done() - next = -> - redirector(req, res, next) \ No newline at end of file diff --git a/views/404.coffee b/views/404.coffee deleted file mode 100644 index 3f1dc0f..0000000 --- a/views/404.coffee +++ /dev/null @@ -1 +0,0 @@ -div id: 'not-found' diff --git a/views/ga.coffee b/views/ga.coffee deleted file mode 100644 index e01970f..0000000 --- a/views/ga.coffee +++ /dev/null @@ -1,13 +0,0 @@ -script ''' - - var _gaq = _gaq || []; - _gaq.push(['_setAccount', 'UA-354018-12']); - _gaq.push(['_trackPageview']); - (function() { - var ga = document.createElement('script'); - ga.type = 'text/javascript'; ga.async = true; - ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; - var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); - })(); - -''' \ No newline at end of file diff --git a/views/index.coffee b/views/index.coffee deleted file mode 100644 index dbbb622..0000000 --- a/views/index.coffee +++ /dev/null @@ -1,5 +0,0 @@ -div id: 'logo' -div id: 'contact', -> - script ''' - document.write("pbagnpg\100urnego\056vg<\057n>".replace(/[a-zA-Z]/g, function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);})); - ''' \ No newline at end of file diff --git a/views/layout.coffee b/views/layout.coffee deleted file mode 100644 index ddd76fe..0000000 --- a/views/layout.coffee +++ /dev/null @@ -1,9 +0,0 @@ -doctype 5 -html -> - head -> - meta charset: 'utf-8' - title 'heartb.it' - link rel: 'stylesheet', href: 'css/style.css' - partial 'ga' - body -> - @body