diff --git a/bin/rss.rb b/bin/rss.rb
index 88b823e..2c6d260 100755
--- a/bin/rss.rb
+++ b/bin/rss.rb
@@ -68,6 +68,7 @@ class Blag
def posts
@posts ||= begin
Dir[File.join(@dir, 'posts/20*/*')].map do |dir|
+ next unless dir =~ /\/\d\d$/
json = File.read File.join(dir, '_data.json')
data = JSON.parse json
prefix = dir.sub(@dir, '')
@@ -85,7 +86,7 @@ class Blag
post['rfc822'] = Time.at(post['timestamp']).rfc822
post
end
- end.flatten.sort_by { |p| -p['timestamp'] }.first(@num_posts)
+ end.flatten.compact.sort_by { |p| -p['timestamp'] }.first(@num_posts)
end
end
diff --git a/public/_layout.ejs b/public/_layout.ejs
index 5e0f483..846c540 100644
--- a/public/_layout.ejs
+++ b/public/_layout.ejs
@@ -94,10 +94,10 @@
∞
<%- yield %>
-
+
<% } else if (typeof date != 'undefined') { -%>
@@ -105,25 +105,20 @@
<%- yield %>
-
+
<% } else if (typeof title != 'undefined') { -%>
<%= title %>
<%- yield %>
-
+
<% } else { -%>
-
- <%- yield %>
-
-
+ <%- yield %>
<% } -%>