Skip to content

Commit

Permalink
updating time:
Browse files Browse the repository at this point in the history
  • Loading branch information
JGrubb committed Feb 6, 2015
1 parent 85371db commit 1ede189
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 46 deletions.
61 changes: 31 additions & 30 deletions Gemfile.lock 100755 → 100644
Expand Up @@ -29,7 +29,7 @@ GEM
tzinfo (~> 1.1)
addressable (2.3.6)
arel (5.0.1.20140414130214)
bcrypt (3.1.7)
bcrypt (3.1.9)
better_errors (2.0.0)
coderay (>= 1.0.0)
erubis (>= 2.6.6)
Expand Down Expand Up @@ -63,23 +63,24 @@ GEM
daemons (1.1.9)
dalli (2.7.2)
debug_inspector (0.0.2)
devise (3.3.0)
devise (3.4.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
responders
thread_safe (~> 0.1)
warden (~> 1.2.3)
diff-lcs (1.2.5)
erubis (2.7.0)
eventmachine (1.0.3)
execjs (2.2.1)
factory_girl (4.4.0)
execjs (2.2.2)
factory_girl (4.5.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.4.1)
factory_girl (~> 4.4.0)
factory_girl_rails (4.5.0)
factory_girl (~> 4.5.0)
railties (>= 3.0.0)
ffi (1.9.3)
foundation-rails (5.4.3.0)
ffi (1.9.6)
foundation-rails (5.4.5.0)
railties (>= 3.1.0)
sass (>= 3.2.0)
friendly_id (5.0.4)
Expand All @@ -104,10 +105,10 @@ GEM
thor (>= 0.14, < 2.0)
json (1.8.1)
kgio (2.9.2)
kramdown (1.4.1)
kramdown (1.5.0)
launchy (2.2.0)
addressable (~> 2.3)
listen (2.7.9)
listen (2.8.0)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
Expand All @@ -121,13 +122,12 @@ GEM
railties (>= 3.0.0, < 5.0.0)
method_source (0.8.2)
mime-types (1.25.1)
mini_magick (3.8.0)
subexec (~> 0.2.1)
mini_portile (0.6.0)
minitest (5.4.1)
mini_magick (4.0.0)
mini_portile (0.6.1)
minitest (5.4.3)
multi_json (1.10.1)
nokogiri (1.6.3.1)
mini_portile (= 0.6.0)
nokogiri (1.6.4.1)
mini_portile (~> 0.6.0)
orm_adapter (0.5.0)
pg (0.17.1)
polyglot (0.3.5)
Expand All @@ -142,7 +142,7 @@ GEM
rack (1.5.2)
rack-cache (1.2)
rack (>= 0.4)
rack-contrib (1.1.0)
rack-contrib (1.2.0)
rack (>= 0.9.1)
rack-test (0.6.2)
rack (>= 1.0)
Expand All @@ -166,7 +166,7 @@ GEM
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rdoc (4.1.1)
rdoc (4.1.2)
json (~> 1.4)
redis (3.1.0)
redis-actionpack (4.0.0)
Expand All @@ -185,6 +185,8 @@ GEM
redis-store (~> 1.1.0)
redis-store (1.1.4)
redis (>= 2.2)
responders (1.1.2)
railties (>= 3.2, < 4.2)
rspec (2.13.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
Expand All @@ -201,10 +203,10 @@ GEM
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
sass (3.2.19)
sass-rails (4.0.3)
sass-rails (4.0.4)
railties (>= 4.0.0, < 5.0)
sass (~> 3.2.0)
sprockets (~> 2.8, <= 2.11.0)
sass (~> 3.2.2)
sprockets (~> 2.8, < 2.12)
sprockets-rails (~> 2.0)
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
Expand All @@ -217,27 +219,26 @@ GEM
sitemap_generator (5.0.5)
builder
slop (3.6.0)
sprockets (2.11.0)
sprockets (2.11.3)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.1.4)
sprockets-rails (2.2.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
subexec (0.2.3)
sprockets (>= 2.8, < 4.0)
terminal-table (1.4.5)
textacular (3.2.0)
activerecord (>= 3.0, < 4.2)
thin (1.6.2)
daemons (>= 1.0.9)
eventmachine (>= 1.0.0)
rack (>= 1.0.0)
thin (1.6.3)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0)
rack (~> 1.0)
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
timers (4.0.0)
timers (4.0.1)
hitimes
treetop (1.4.15)
polyglot
Expand Down
9 changes: 6 additions & 3 deletions app/controllers/posts_controller.rb
Expand Up @@ -23,9 +23,12 @@ def search
def archive
posts = Post.published.sorted.reverse_order
years = (2009..Time.now.year).to_a.reverse
@posts_by_year = {}
years.each do |year|
@posts_by_year[year.to_s] = posts.select { |a| a.created_at.year == year }
if stale?(etag: posts, last_modified: posts.first.updated_at, public: true)
@posts_by_year = {}
years.each do |year|
@posts_by_year[year.to_s] = posts.select { |a| a.created_at.year == year }
end
expires_in 7.days, public: true
end
end

Expand Down
6 changes: 3 additions & 3 deletions app/helpers/application_helper.rb
Expand Up @@ -3,9 +3,9 @@
module ApplicationHelper

def markdown_filter(text)
options = {
coderay_line_numbers: :table
}
options = {
coderay_line_numbers: nil
}
Kramdown::Document.new(text, options).to_html.html_safe
end

Expand Down
10 changes: 0 additions & 10 deletions app/views/posts/show.html.erb
Expand Up @@ -12,17 +12,7 @@
<p><% if @post.tags.any? %>Filed under: <%= tags_link %><% end %></p>
</div>
<%= render 'links' %>
<!-- left_boombox -->
<ins class="adsbygoogle"
style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-8462997423242867"
data-ad-slot="7595780432"></ins>
<div id="disqus_thread"></div>
<!-- right_boombox -->
<ins class="adsbygoogle"
style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-8462997423242867"
data-ad-slot="3025980039"></ins>
<%= render 'links' %>
</div>

Expand Down

0 comments on commit 1ede189

Please sign in to comment.