Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Going to sinatra
  • Loading branch information
steveklabnik committed May 12, 2011
1 parent a5935ba commit 8ffc51c
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 109 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -5,5 +5,5 @@ gem "pygmentize"
gem "rdiscount"
gem "haml"
gem "sass"
gem "sinatra"
gem "coffee-script"
gem "jammit"
18 changes: 6 additions & 12 deletions Gemfile.lock
@@ -1,13 +1,8 @@
GEM
remote: http://rubygems.org/
specs:
POpen4 (0.1.4)
Platform (>= 0.4.0)
open4
Platform (0.4.0)
classifier (1.3.3)
fast-stemmer (>= 1.0.0)
closure-compiler (1.1.1)
coffee-script (2.2.0)
coffee-script-source
execjs
Expand All @@ -17,9 +12,6 @@ GEM
multi_json (~> 1.0)
fast-stemmer (1.0.0)
haml (3.1.1)
jammit (0.6.0)
closure-compiler (>= 0.1.0)
yui-compressor (>= 0.9.1)
jekyll (0.10.0)
classifier (>= 1.3.1)
directory_watcher (>= 1.1.1)
Expand All @@ -29,22 +21,24 @@ GEM
maruku (0.6.0)
syntax (>= 1.0.0)
multi_json (1.0.1)
open4 (1.0.1)
pygmentize (0.0.2)
rack (1.2.2)
rdiscount (1.6.8)
sass (3.1.1)
sinatra (1.2.0)
rack (~> 1.1)
tilt (< 2.0, >= 1.2.2)
syntax (1.0.0)
yui-compressor (0.9.6)
POpen4 (>= 0.1.4)
tilt (1.2.2)

PLATFORMS
ruby

DEPENDENCIES
coffee-script
haml
jammit
jekyll
pygmentize
rdiscount
sass
sinatra
5 changes: 0 additions & 5 deletions Rakefile
Expand Up @@ -24,12 +24,7 @@ end
desc "Package app for production"
task :package do
ENV['JEKYLL_ENV'] = 'production'

Rake::Task["build"].invoke

print "Compressing assets..."
system "jammit -o assets -c _assets.yml"
puts "done."
end

desc "Deploy latest code in _site to production"
Expand Down
8 changes: 0 additions & 8 deletions _assets.yml

This file was deleted.

19 changes: 16 additions & 3 deletions _layouts/default.html
Expand Up @@ -3,10 +3,23 @@
<head>
<meta charset='utf8' />
<title>Literate Programming</title>
{% include_css site %}
{% include_js jquery-1.6.min %}
{% include_js app %}
<link href='/css/site.css' rel='stylesheet' />
<script src='/js/jquery-1.6.min.js'></script>
<script src='/js/app.js'></script>
</head>
<script type='text/javascript'>
//<![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-4054156-1']);
_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';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();
//]]>
</script>
<body>
<section id='right'>
<aside>
Expand Down
6 changes: 3 additions & 3 deletions _layouts/haml/default.haml
Expand Up @@ -3,9 +3,9 @@
%head
%meta{:charset => "utf8"}
%title Literate Programming
{% include_css site %}
{% include_js jquery-1.6.min %}
{% include_js app %}
%link{ :rel => "stylesheet", :href => "/css/site.css"}/
%script{:src => "/js/jquery-1.6.min.js"}
%script{:src => "/js/app.js"}
- if ENV['JEKYLL_ENV'] == "production"
:javascript
var _gaq = _gaq || [];
Expand Down
8 changes: 4 additions & 4 deletions _layouts/haml/post.haml
Expand Up @@ -2,10 +2,10 @@
%html{:lang => "en"}
%head
%meta{:charset => "utf8"}
%title Literate Coding - {{ page.title }}
{% include_css site %}
{% include_js jquery-1.6.min %}
{% include_js app %}
%title Literate Programming - {{ page.title }}
%link{ :rel => "stylesheet", :href => "/css/site.css"}/
%script{:src => "/js/jquery-1.6.min.js"}
%script{:src => "/js/app.js"}
- if ENV['JEKYLL_ENV'] == "production"
:javascript
var _gaq = _gaq || [];
Expand Down
21 changes: 17 additions & 4 deletions _layouts/post.html
Expand Up @@ -2,11 +2,24 @@
<html lang='en'>
<head>
<meta charset='utf8' />
<title>Literate Coding - {{ page.title }}</title>
{% include_css site %}
{% include_js jquery-1.6.min %}
{% include_js app %}
<title>Literate Programming - {{ page.title }}</title>
<link href='/css/site.css' rel='stylesheet' />
<script src='/js/jquery-1.6.min.js'></script>
<script src='/js/app.js'></script>
</head>
<script type='text/javascript'>
//<![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-4054156-1']);
_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';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();
//]]>
</script>
<body>
<section id='right'>
<aside>
Expand Down
69 changes: 0 additions & 69 deletions _plugins/asset_tag.rb

This file was deleted.

1 change: 1 addition & 0 deletions _posts/2010-06-30-case-study-in-being-excellent-divvy.md
Expand Up @@ -41,3 +41,4 @@ EDIT: They've posted the sales afterward on Reddit [here][10].
[9]: http://www.mizage.com/divvy/
[10]: http://www.reddit.com/r/programming/comments/cmmfg/hey_reddit_a_week_ago_someone_posted_about_divvy/


16 changes: 16 additions & 0 deletions blog.rb
@@ -0,0 +1,16 @@
require 'sinatra/base'


class Blog < Sinatra::Base
set :root, File.dirname(__FILE__)
set :public, Proc.new { File.join(root, "_site") }

before do
response.headers['Cache-Control'] = 'public, max-age=31557600' # 1 year
end

get '/' do
File.read('_site/index.html')
end
end

8 changes: 8 additions & 0 deletions config.ru
@@ -0,0 +1,8 @@
require 'rubygems'
require 'bundler/setup'
require "sinatra"

require"./blog"

run Blog.new

2 comments on commit 8ffc51c

@zzak
Copy link
Contributor

@zzak zzak commented on 8ffc51c May 16, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But ofcourse

@steveklabnik
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotta get those redirects in there somehow!

Please sign in to comment.