Skip to content

Commit

Permalink
move to dropbox for blog post hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
stefl committed Aug 17, 2012
1 parent 36a762b commit b0a29a7
Show file tree
Hide file tree
Showing 60 changed files with 338 additions and 1,558 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -5,4 +5,5 @@ bin/*
vendor/gems/*
!vendor/gems/cache/
.sass-cache/*
foreman.env
foreman.env
.env
7 changes: 6 additions & 1 deletion Gemfile
Expand Up @@ -10,4 +10,9 @@ gem 'padrino', '0.10.5'
gem 'unicorn'
gem 'twitter'
gem 'hashie'
gem 'dropbox-sdk', :require =>'dropbox_sdk'
#gem 'dropbox-sdk', :require =>'dropbox_sdk'
gem 'dropbox-api'
gem 'dalli'
gem 'resque'
gem 'hirefire'
gem 'mongoid'
60 changes: 56 additions & 4 deletions Gemfile.lock
Expand Up @@ -13,10 +13,16 @@ GIT
GEM
remote: http://rubygems.org/
specs:
activemodel (3.1.4)
activesupport (= 3.1.4)
builder (~> 3.0.0)
i18n (~> 0.6)
activesupport (3.1.4)
multi_json (~> 1.0)
addressable (2.3.2)
albino (1.3.3)
posix-spawn (>= 0.3.6)
builder (3.0.0)
chunky_png (1.2.5)
classifier (1.3.3)
fast-stemmer (>= 1.0.0)
Expand All @@ -27,24 +33,40 @@ GEM
dalli (2.0.3)
diff-lcs (1.1.3)
directory_watcher (1.4.1)
dropbox-sdk (1.3)
json
dropbox-api (0.3.1)
hashie
multi_json
oauth
excon (0.16.1)
faraday (0.8.0)
multipart-post (~> 1.1)
fast-stemmer (1.0.1)
fattr (2.2.1)
fssm (0.2.9)
grit (2.4.1)
diff-lcs (~> 1.1)
mime-types (~> 1.15)
haml (3.1.4)
hashie (1.2.0)
heroku (2.30.3)
heroku-api (~> 0.3.4)
launchy (>= 0.3.2)
netrc (~> 0.7.7)
rest-client (~> 1.6.1)
rubyzip
heroku-api (0.3.4)
excon (~> 0.16.1)
hirefire (0.1.4)
heroku (>= 1.4)
rush (~> 0.6.7)
http_router (0.10.2)
rack (>= 1.0.0)
url_mount (~> 0.2.1)
i18n (0.6.0)
json (1.7.4)
kgio (2.7.4)
kramdown (0.13.6)
launchy (2.1.2)
addressable (~> 2.3)
liquid (2.3.0)
mail (2.3.3)
i18n (>= 0.4.0)
Expand All @@ -53,8 +75,17 @@ GEM
maruku (0.6.0)
syntax (>= 1.0.0)
mime-types (1.18)
mongoid (3.0.3)
activemodel (~> 3.1)
moped (~> 1.1)
origin (~> 1.0)
tzinfo (~> 0.3.22)
moped (1.2.0)
multi_json (1.3.4)
multipart-post (1.1.5)
netrc (0.7.7)
oauth (0.4.6)
origin (1.0.6)
padrino (0.10.5)
padrino-admin (= 0.10.5)
padrino-cache (= 0.10.5)
Expand Down Expand Up @@ -90,7 +121,22 @@ GEM
rack
raindrops (0.8.0)
rake (0.9.2.2)
redis (3.0.1)
redis-namespace (1.2.1)
redis (~> 3.0.0)
resque (1.21.0)
multi_json (~> 1.0)
redis-namespace (~> 1.0)
sinatra (>= 0.9.2)
vegas (~> 0.1.2)
rest-client (1.6.7)
mime-types (>= 1.16)
rubyzip (0.9.9)
rush (0.6.8)
session
sass (3.2.0.alpha.242)
session (3.1.0)
fattr
simple_oauth (0.1.8)
sinatra (1.3.2)
rack (~> 1.3, >= 1.3.6)
Expand All @@ -112,25 +158,31 @@ GEM
faraday (~> 0.8)
multi_json (~> 1.3)
simple_oauth (~> 0.1.6)
tzinfo (0.3.33)
unicorn (4.3.0)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
url_mount (0.2.1)
rack
vegas (0.1.11)
rack (>= 1.0.0)

PLATFORMS
ruby

DEPENDENCIES
compass (= 0.12.2.rc.0)
dalli
dropbox-sdk
dropbox-api
haml
hashie
hirefire
jekyll!
mongoid
padrino (= 0.10.5)
rake
resque
sinatra-flash
susy (= 1.0.rc.0)
twitter
Expand Down
1 change: 1 addition & 0 deletions Procfile
@@ -1 +1,2 @@
web: bundle exec unicorn -p $PORT -c ./unicorn.rb
worker: bundle exec rake resque:work QUEUE=web
3 changes: 2 additions & 1 deletion Procfile.dev
@@ -1,2 +1,3 @@
compass: bundle exec compass watch
web: bundle exec unicorn -p 4141 -c ./unicorn.rb
web: bundle exec unicorn -p 4141 -c ./unicorn.rb
worker: bundle exec rake resque:work QUEUE=web
2 changes: 2 additions & 0 deletions Rakefile
@@ -0,0 +1,2 @@
require File.expand_path("config/boot.rb")
require 'resque/tasks'
2 changes: 1 addition & 1 deletion app/app.rb
Expand Up @@ -5,7 +5,7 @@ class Sketching < Padrino::Application
register Padrino::Cache

enable :caching
#set :cache, Padrino::Cache::Store::Memcache.new(::Dalli::Client.new(ENV["MEMCACHE_SERVERS"] || '127.0.0.1:11211', :exception_retry_limit => 1))
set :cache, Padrino::Cache::Store::Memcache.new(::Dalli::Client.new(ENV["MEMCACHE_SERVERS"] || '127.0.0.1:11211', :exception_retry_limit => 1))

disable :sessions
disable :flash
Expand Down
38 changes: 0 additions & 38 deletions app/controllers/blog.rb

This file was deleted.

27 changes: 27 additions & 0 deletions app/controllers/posts.rb
@@ -0,0 +1,27 @@
# encoding: utf-8

Sketching.controllers :posts do

get :index, :map=>"/" do
#expires_in 30
@posts = Post.all.order_by([[:published_at, :desc]])
haml :"posts/index", :layout => !request.xhr?
end

get :show, :map => "/:year/:month/:day/:slug" do
#expires_in 30
@post = Post.where(:slug => params[:slug]).first
haml :"posts/show", :layout => !request.xhr?
end

post :refresh, :map => "/posts/refresh" do
Resque.enqueue(PostFetching)
redirect "/"
end

# get :sitemap, :map => "/blog/sitemap", :provides => [:xml] do
# #expires_in 30
# File.open(blog_path + "/sitemap.xml").read
# end

end
7 changes: 7 additions & 0 deletions app/stylesheets/application.scss
Expand Up @@ -30,6 +30,7 @@ body {
color: #222;
}


.sixteen-nine {
position: relative;
padding-bottom: 56.25%;
Expand Down Expand Up @@ -102,6 +103,12 @@ h1 {
}
}

p {
strong {
font-weight: bold;
}
}

header#header {
h1 {
&#logo {
Expand Down
6 changes: 0 additions & 6 deletions app/views/blog/index.haml

This file was deleted.

16 changes: 0 additions & 16 deletions app/views/blog/post.haml

This file was deleted.

4 changes: 2 additions & 2 deletions app/views/layouts/application.haml
Expand Up @@ -22,7 +22,7 @@
%link{:href => "/stylesheets/application.css", :media => "screen, projection", :rel => "stylesheet", :type => "text/css"}/
= favicon_tag '/favicon.ico'
%script{:src=>"/assets/modernizr.js",:type=>"text/javascript"}
%script{:src=>"/javascripts/modernizr.js",:type=>"text/javascript"}
<script type="text/javascript" src="http://use.typekit.com/sla1ora.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
Expand Down Expand Up @@ -93,7 +93,7 @@


%footer

= button_to "Refresh", url_for(:posts, :refresh), :method => :post
= yield_content :scripts
%script{:src=>"//platform.twitter.com/widgets.js", :charset=>"utf-8", :type=>"text/javascript"}

Expand Down
18 changes: 18 additions & 0 deletions app/views/posts/index.haml
@@ -0,0 +1,18 @@
%section.posts
- @posts.each do |post|
%article.post
%header
- if post.draft
%h1.draft= post.title
%p
Draft
- else
%h1= link_to(post.title, post.url)
%p
= distance_of_time_in_words(Date.today, post.published_at)
ago


%p#draft_items
%em
Items marked as "draft" are me making a promise that I will write about this subject, but I'm still thinking it through.
10 changes: 10 additions & 0 deletions app/views/posts/show.haml
@@ -0,0 +1,10 @@
- content_for :scripts do
%script{:src => "http://disqus.com/forums/sketchingwithcode/embed.js", :type => "text/javascript"}
%article
%header
%h1= @post.title
= @post.content_html
%footer#comments
#disqus_thread
%noscript
%a{:href => "http://sketchingwithcode.disqus.com/?url=ref"} View the discussion thread.
42 changes: 0 additions & 42 deletions blog/_config.yml

This file was deleted.

1 change: 0 additions & 1 deletion blog/_layouts/default.html

This file was deleted.

7 changes: 0 additions & 7 deletions blog/_layouts/post.html

This file was deleted.

0 comments on commit b0a29a7

Please sign in to comment.