Skip to content

Commit

Permalink
renovate blog quickly
Browse files Browse the repository at this point in the history
bring in posts from summer's blog

update with a better understanding of how to use jekyll and Sass

option to include specific scripts or styles on a per-page basis
  • Loading branch information
Max Jacobson committed Nov 7, 2013
1 parent f63dc66 commit 19ca8a1
Show file tree
Hide file tree
Showing 129 changed files with 5,563 additions and 775 deletions.
5 changes: 3 additions & 2 deletions 404.html
@@ -1,9 +1,10 @@
---
layout: default
title: 404
scripts:
- 404
---

<h2>404</h2>

<p>Sorry, that page was not found.</p>
<script src="/js/404.js"></script>

1 change: 1 addition & 0 deletions CNAME
@@ -0,0 +1 @@
www.hardscrabble.net
6 changes: 6 additions & 0 deletions Gemfile
@@ -1,5 +1,11 @@
source "https://rubygems.org"

gem 'jekyll'

gem 'kramdown'

gem 'guard'
gem 'guard-sass'
gem 'guard-coffeescript'
gem 'guard-jekyll-plus'

54 changes: 28 additions & 26 deletions Gemfile.lock
Expand Up @@ -7,67 +7,67 @@ GEM
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.6.2)
coffee-script-source (1.6.3)
colorator (0.1)
commander (4.1.3)
commander (4.1.5)
highline (~> 1.6.11)
directory_watcher (1.4.1)
execjs (1.4.0)
multi_json (~> 1.0)
execjs (2.0.2)
fast-stemmer (1.0.2)
ffi (1.8.1)
ffi (1.9.3)
formatador (0.2.4)
guard (1.8.0)
guard (1.8.3)
formatador (>= 0.2.4)
listen (>= 1.0.0)
listen (~> 1.3)
lumberjack (>= 1.0.2)
pry (>= 0.9.10)
thor (>= 0.14.6)
guard-coffeescript (1.3.0)
guard-coffeescript (1.3.4)
coffee-script (>= 2.2.0)
guard (>= 1.1.0)
guard-sass (1.1.0)
guard-jekyll-plus (1.4.10)
guard (~> 1.8.3)
jekyll (>= 1.0.0)
guard-sass (1.3.2)
guard (>= 1.1.0)
sass (>= 3.1)
highline (1.6.16)
jekyll (1.0.2)
highline (1.6.20)
jekyll (1.2.1)
classifier (~> 1.3)
colorator (~> 0.1)
commander (~> 4.1.3)
directory_watcher (~> 1.4.1)
kramdown (~> 1.0.2)
liquid (~> 2.3)
liquid (~> 2.5.2)
maruku (~> 0.5)
pygments.rb (~> 0.5.0)
redcarpet (~> 2.3.0)
safe_yaml (~> 0.7.0)
kramdown (1.0.2)
liquid (2.5.0)
listen (1.1.2)
kramdown (1.2.0)
liquid (2.5.3)
listen (1.3.1)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
rb-kqueue (>= 0.2)
lumberjack (1.0.3)
maruku (0.6.1)
syntax (>= 1.0.0)
method_source (0.8.1)
multi_json (1.7.3)
lumberjack (1.0.4)
maruku (0.7.0)
method_source (0.8.2)
posix-spawn (0.3.6)
pry (0.9.12.2)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
pygments.rb (0.5.0)
pygments.rb (0.5.4)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
rb-fsevent (0.9.3)
rb-inotify (0.9.0)
rb-inotify (0.9.2)
ffi (>= 0.5.0)
rb-kqueue (0.2.0)
ffi (>= 0.5.0)
redcarpet (2.3.0)
safe_yaml (0.7.1)
sass (3.2.9)
slop (3.4.5)
syntax (1.0.0)
sass (3.2.12)
slop (3.4.6)
thor (0.18.1)
yajl-ruby (1.1.0)

Expand All @@ -77,5 +77,7 @@ PLATFORMS
DEPENDENCIES
guard
guard-coffeescript
guard-jekyll-plus
guard-sass
jekyll
kramdown
12 changes: 10 additions & 2 deletions Guardfile
@@ -1,2 +1,10 @@
guard 'coffeescript', :input => '_coffee', :output => 'js'
guard 'sass', :input => '_scss', :output => 'css'
notification :off

guard 'coffeescript', :input => '_coffee', :output => 'js', :all_on_start => true
guard 'sass', :input => '_scss', :output => 'css', :all_on_start => true

guard 'jekyll-plus', :serve => true, :baseurl => '/', :port => '1234' do
watch /.*/
ignore /^_site/
end

8 changes: 4 additions & 4 deletions README.md
@@ -1,9 +1,9 @@
# [maxjacobson.github.io](http://maxjacobson.github.io)
# [hardscrabble.net](http://hardscrabble.net)

My new homepage?
my personal site. powered by [jekyll](http://jekyllrb.com/) and hosted on [github pages](http://pages.github.com/)

## working on the site

* Run `bundle` to get the necessary gems.
* Run `guard` to watch & compile the scss and coffeescript.
* Run `jekyll serve -w` to build and preview the site at <http://localhost:4000>
* Run `bundle exec guard` to watch & compile the scss and coffeescript and preview the site at <http://localhost:1234>

18 changes: 14 additions & 4 deletions _coffee/404.coffee
@@ -1,5 +1,15 @@
root = "http://hardscrabble.net"
current_url = document.URL
pattern = /(\d{4})\-\d{2}\-\d{2}\-([a-z\-]+)$/i
if current_url.match pattern
match = current_url.match pattern
window.location.replace "http://maxjacobson.github.io/#{match[1]}/#{match[2]}/"

beefsteak = /(\d{4})\-\d{2}\-\d{2}\-([a-z\-]+)$/i
if current_url.match beefsteak
alert "please update your bookmarks, the site has moved from maxjacobson.net!!!"
match = current_url.match beefsteak
window.location.replace "#{root}/#{match[1]}/#{match[2]}/"

octopress = /blog\/(\d{4}\/[a-z\-]+)$/i
if current_url.match octopress
alert "please update your bookmarks, the site has moved from maxjacobson.github.io!!!"
match = current_url.match octopress
window.location.replace "#{root}/#{match[1]}/"

29 changes: 1 addition & 28 deletions _coffee/app.coffee
@@ -1,29 +1,2 @@
puts = (putter) -> console.log putter
$ ->
# check progress
tasks =
total: 0
complete: 0
$("li").each (i) ->
done_frac = /\– (\d+)\/(\d+)$/i
match = $(this).text().match done_frac
if match
numerator = parseInt match[1], 10
denominator = parseInt match[2], 10
tasks.total += denominator
tasks.complete += numerator
percentage = "#{Math.floor((numerator/denominator)*100)}%"
$(this).append "#{percentage}"
# $(this).find("a").addClass "strikeout" if percentage is "100%"
$(this).append($("<br/>")).append($("<div class='progress #{'progress-striped active' if percentage isnt "100%"}'><div class='bar' style='width: #{percentage};'></div></div>"))
if tasks.total isnt 0
total_percentage = "#{Math.floor((tasks.complete/tasks.total)*100)}%"
$("<p><strong>#{total_percentage} of total prework complete</strong></p>").insertBefore "#post h2:first"
$("<div class='progress #{'progress-striped active' if total_percentage isnt '100%'}'><div class='bar' style='width: #{total_percentage};'></div></div>").insertBefore "#post h2:first"
document.title = "#{total_percentage} - #{document.title}"
$("h1,h2,h3,h4").on "click", ->
clicked_id = $(this).attr "id"
if clicked_id isnt undefined
window.location.replace '#' + clicked_id
else
window.location.replace ''
puts "page ready"
2 changes: 2 additions & 0 deletions _coffee/helpers.coffee
@@ -0,0 +1,2 @@
window.puts = (thing) -> console.log thing

29 changes: 29 additions & 0 deletions _coffee/prework.coffee
@@ -0,0 +1,29 @@
$ ->
# check progress
tasks =
total: 0
complete: 0
$("li").each (i) ->
done_frac = /\– (\d+)\/(\d+)$/i
match = $(this).text().match done_frac
if match
numerator = parseInt match[1], 10
denominator = parseInt match[2], 10
tasks.total += denominator
tasks.complete += numerator
percentage = "#{Math.floor((numerator/denominator)*100)}%"
$(this).append "#{percentage}"
# $(this).find("a").addClass "strikeout" if percentage is "100%"
$(this).append($("<br/>")).append($("<div class='progress #{'progress-striped active' if percentage isnt "100%"}'><div class='bar' style='width: #{percentage};'></div></div>"))
if tasks.total isnt 0
total_percentage = "#{Math.floor((tasks.complete/tasks.total)*100)}%"
$("<p><strong>#{total_percentage} of total prework complete</strong></p>").insertBefore "#post h2:first"
$("<div class='progress #{'progress-striped active' if total_percentage isnt '100%'}'><div class='bar' style='width: #{total_percentage};'></div></div>").insertBefore "#post h2:first"
document.title = "#{total_percentage} - #{document.title}"
$("h1,h2,h3,h4").on "click", ->
clicked_id = $(this).attr "id"
if clicked_id isnt undefined
window.location.replace '#' + clicked_id
else
window.location.replace ''

22 changes: 16 additions & 6 deletions _config.yml
@@ -1,8 +1,18 @@
name: Max Jacobson
description: A dorkblog
url: http://maxjacobson.github.io
title: hardscrabble
author: Max Jacobson

url: http://hardscrabble.net
baseurl: /

permalink: /:year/:title
markdown: kramdown
relative_permalinks: true
exclude: ["Gemfile", "Gemfile.lock", "Guardfile", "README.md"]
my_pages: ["feed", "about"]

exclude:
- "Gemfile"
- "Gemfile.lock"
- "Guardfile"
- "README.md"

markdown: kramdown
pygments: true

5 changes: 5 additions & 0 deletions _includes/footer.html
@@ -0,0 +1,5 @@
<footer>
<p><a href="{{ site.baseurl }}about/">About</a></p>
<p>All posts in <a href="{{ site.baseurl }}archive/">Archive</a>. <a href="{{ site.baseurl }}feed.xml">RSS Feed</a> available.</p>
</footer>

4 changes: 4 additions & 0 deletions _includes/header.html
@@ -0,0 +1,4 @@
<header>
<h1><a href="{{ site.baseurl }}">{{ site.title }}</a></h1>
</header>

7 changes: 7 additions & 0 deletions _includes/javascripts.html
@@ -0,0 +1,7 @@
<script src='{{ site.baseurl }}js/lib/jquery.min.js'></script>
<script src='{{ site.baseurl }}js/helpers.js'></script>
<script src='{{ site.baseurl }}js/app.js'></script>
{% for script in page.scripts %}
<script src='{{ site.baseurl }}js/{{ script }}.js'></script>
{% endfor %}

5 changes: 5 additions & 0 deletions _includes/stylesheets.html
@@ -0,0 +1,5 @@
<link rel="stylesheet" href="{{ site.baseurl }}css/style.css">
{% for stylesheet in page.stylesheets %}
<link rel="stylesheet" href="{{ site.baseurl }}css/{{ stylesheet }}.css">
{% endfor %}

40 changes: 10 additions & 30 deletions _layouts/default.html
Expand Up @@ -2,38 +2,18 @@
<html lang='en'></html>
<head>
<meta charset='UTF-8'>
<title>{{ page.title }} | Max Jacobson</title>
<meta content='Max Jacobson' name='author'>
<link href='/feed' rel='alternate' title='Posts feed' type='application/atom+xml'>
<link rel="stylesheet" href="/css/lib/bootstrap.min.css">
<link rel="stylesheet" href="/css/lib/bootstrap-responsive.min.css">
<link rel="stylesheet" href="/css/style.css">
<title>{{ page.title }} - {{ site.title }}</title>
<meta content='{{ site.author }}' name='author'>
<link href='/feed.xml' rel='alternate' title='Posts feed' type='application/atom+xml'>
<link href='/img/favicon.ico' rel='icon' type='image/x-icon'>
{% include stylesheets.html %}
</head>
<body>
<header>
<h1>
<a href="/">Max Jacobson</a>
</h1>
</header>

<div class='yield'>
{{ content }}
</div>

<footer>
<h2>Arrive alive!</h2>
<ul class="links">
<li><a href="https://twitter.com/maxjacobson" class="twitter-follow-button" data-show-count="true" data-size="large" data-dnt="true">Follow @maxjacobson</a></li>
<li><a href='https://alpha.app.net/intent/follow/?user_id=%40maxjacobson' class='adn-button' target='_blank' data-type='follow' data-width='277' data-height='27' data-user-id='@maxjacobson' data-show-username='1'>Follow me on App.net</a></li>
<li><iframe src="http://ghbtns.com/github-btn.html?user=maxjacobson&type=follow&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="165" height="20"></iframe></li>
<li><a href="/feed">RSS Feed</a></li>
</ul>
</footer>
<script src='/js/lib/jquery.js'></script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<script>(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src='//d2zh9g63fcvyrq.cloudfront.net/adn.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'adn-button-js'));</script>
<script src='/js/app.js'></script>
{% include header.html %}
{{ content }}
{% include footer.html %}
{% include javascripts.html %}
</body>
</html>
</html>

21 changes: 12 additions & 9 deletions _layouts/post.html
@@ -1,13 +1,16 @@
---
layout: default
---
<h2>{{ page.title }}</h2>
<p class="date">{{ page.date | date_to_string }}</p>
{% if page.beverage %}
<p class="beverage"><strong>Beverage:</strong> {{ page.beverage }}</p>
{% endif %}
<p>Markdown source <a href="https://raw.github.com/maxjacobson/maxjacobson.github.io/master/{{page.path}}">on GitHub</a></p>

<div id="post">
{{ content }}

<div class="post">

<h2>{{ page.title }}</h2>

<p class="date">{{ page.date | date_to_string }}</p>

{{ content }}

<p>Markdown source <a href="https://raw.github.com/maxjacobson/maxjacobson.github.io/master/{{page.path}}">on GitHub</a></p>

</div>

5 changes: 3 additions & 2 deletions _posts/2007-02-20-movie-universes.md
@@ -1,9 +1,10 @@
---
layout: post
title: "Movie Universes"
title: Movie Universes
date: 2007-02-20 12:00 AM
category: pop culture
tags: from the archives
tags:
- from the archives
---

It occurs to me that movie story telling has a hole in it. In The Matador, when Julian (played by Pierce *Brosnan*) is flirting with Genevive, the receptionist at the airline, why doesn't she go, "Oh my God, you're Pierce Brosnan! I saw all the Bond movies you were in, I'm your biggest fan!"?
Expand Down
8 changes: 6 additions & 2 deletions _posts/2007-02-21-art-appreciator-or-one-of-pavlovs-dog.md
@@ -1,9 +1,13 @@
---
layout: post
title: "Art appreciator or one of Pavlov&rsquo;s dog?"
title: Art appreciator or one of Pavlov&rsquo;s dog?
date: 2007-02-21 12:00 AM
category: pop culture
tags: psychology, film, from the archives, music
tags:
- psychology
- film
- from the archives
- music
---

In my Psychology class today we talked about Pavlov's dogs, the ones that were conditioned to start drooling at the sound of a bell, because they were trained to associate it with food.
Expand Down

0 comments on commit 19ca8a1

Please sign in to comment.