mirror of
https://github.com/jimeh/heartb.it.git
synced 2026-02-19 12:56:47 +00:00
First stab at turning this into a Github Pages site
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,4 +1,3 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
docs
|
||||
*.js
|
||||
.sass-cache/*
|
||||
_site/*
|
||||
|
||||
4
404.html
Normal file
4
404.html
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
permalink: /404.html
|
||||
---
|
||||
<div id="not-found"></div>
|
||||
11
Dockerfile
11
Dockerfile
@@ -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"]
|
||||
141
Gemfile.lock
Normal file
141
Gemfile.lock
Normal file
@@ -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
|
||||
34
Makefile
34
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:
|
||||
|
||||
@@ -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/)
|
||||
|
||||
8
_config.yml
Normal file
8
_config.yml
Normal file
@@ -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
|
||||
10
_includes/ga.html
Normal file
10
_includes/ga.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<script>
|
||||
if (window.location.hostname == "{{ site.hostname }}") {
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', 'UA-354018-12', 'auto');
|
||||
ga('send', 'pageview');
|
||||
} else { _gaq = []; };
|
||||
</script>
|
||||
5
_includes/head.html
Normal file
5
_includes/head.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ site.title }}</title>
|
||||
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
|
||||
</head>
|
||||
8
_layouts/default.html
Normal file
8
_layouts/default.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
{% include head.html %}
|
||||
<body>
|
||||
{{ content }}
|
||||
{% include ga.html %}
|
||||
</body>
|
||||
</html>
|
||||
48
_sass/_layout.scss
Normal file
48
_sass/_layout.scss
Normal file
@@ -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;
|
||||
}
|
||||
7
_sass/_webfonts.scss
Normal file
7
_sass/_webfonts.scss
Normal file
@@ -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");
|
||||
}
|
||||
34
app.coffee
34
app.coffee
@@ -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
|
||||
5
css/main.scss
Normal file
5
css/main.scss
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
# Only the main Sass file needs front matter (the dashes are enough)
|
||||
---
|
||||
|
||||
@import "webfonts", "layout";
|
||||
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
7
index.html
Normal file
7
index.html
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
<div id="logo"></div>
|
||||
<div id="contact">
|
||||
<script>document.write("<n uers=\"znvygb:pbagnpg@urnego.vg\">pbagnpg@urnego.vg</n>".replace(/[a-zA-Z]/g, function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);}));</script>
|
||||
</div>
|
||||
@@ -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()
|
||||
22
package.json
22
package.json
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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)
|
||||
@@ -1 +0,0 @@
|
||||
div id: 'not-found'
|
||||
@@ -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);
|
||||
})();
|
||||
|
||||
'''
|
||||
@@ -1,5 +0,0 @@
|
||||
div id: 'logo'
|
||||
div id: 'contact', ->
|
||||
script '''
|
||||
document.write("<n uers=\\"znvygb:pbagnpg\100urnego\056vg\\">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);}));
|
||||
'''
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user