Skip to content

Commit

Permalink
clayoven: nil'ify topics when topics.length = 1
Browse files Browse the repository at this point in the history
  • Loading branch information
artagnon committed Jan 15, 2015
1 parent 476ee71 commit c5bb4fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
21 changes: 7 additions & 14 deletions lib/clayoven.rb
@@ -1,10 +1,8 @@
$:.unshift __dir__

require 'slim'
require 'clayoven/config'
require 'clayoven/clayfeed'
require 'clayoven/claytext'
require 'clayoven/httpd'
require_relative 'clayoven/config'
require_relative 'clayoven/clayfeed'
require_relative 'clayoven/claytext'
require_relative 'clayoven/httpd'

# Sorts a list of filenames by first-committed time.
def git_sort files, reverse_p
Expand Down Expand Up @@ -105,13 +103,8 @@ def self.main
page.pubdate = `git log --reverse --format="%aD" #{page.filename} | head -n 1`.split(' ')[0..3].join(' ')
end

# Compute the indexfill for indexes
topics.each do |topic|
topic_index = index_pages.select { |page| page.topic == topic }[0]
topic_index.indexfill = content_pages.select { |page| page.topic == topic }
end

(index_pages + content_pages).each { |page| page.render topics }
ClayFeed.render!(content_pages)
(index_pages + content_pages).each { |page| page.render (if topics.length == 1
then nil else topics end) }
# ClayFeed.render! content_pages
end
end
2 changes: 0 additions & 2 deletions lib/clayoven/clayfeed.rb
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

require 'rss'
require_relative 'config'

Expand Down

0 comments on commit c5bb4fd

Please sign in to comment.