diff --git a/TODO b/TODO index 60f4104..95d0515 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -* Todo [8/15] +* Todo [9/17] - [X] switch to creation dates - [X] hide drafts in categories, but compile them anyway - [X] better rss feed (automatic items based on dates, changelog) @@ -14,4 +14,5 @@ - [ ] search bar prettier - [ ] imply all_sites without -s - [ ] next_prev for first page float broken -- [ ] tidy html in RSS feed for compression +- [X] tidy html in RSS feed for compression +- [ ] fork nanoc, move site config there diff --git a/lib/rss.rb b/lib/rss.rb index 34c1516..dc4ac04 100644 --- a/lib/rss.rb +++ b/lib/rss.rb @@ -30,7 +30,7 @@ def rss_feed i.title = "#{item[:title]}" i.link = "#{@site.url}" + item.path i.date = item[:date].to_time - i.description = item.compiled_content + i.description = tidy item.compiled_content end # mod date is newest article / entry in log diff --git a/lib/tidy.rb b/lib/tidy.rb index dc51663..982ce3c 100644 --- a/lib/tidy.rb +++ b/lib/tidy.rb @@ -8,12 +8,17 @@ require 'tidy_ffi' class TidyFilter < Nanoc::Filter identifier :tidy def run(content, params={}) - TidyFFI::Tidy.new(content, - :wrap => 80, - :tidy_mark => false, - :indent => 1, - :char_encoding => "utf8", - :hide_comments => true, - ).clean + tidy content end end + +def tidy text + TidyFFI::Tidy.new(text, + :wrap => 80, + :tidy_mark => false, + :indent => 1, + :char_encoding => "utf8", + :hide_comments => true, + :show_body_only => "auto" + ).clean +end