clean rss content

master
muflax 2012-05-30 06:06:54 +02:00
parent dea5cd3245
commit 70e98b121f
3 changed files with 16 additions and 10 deletions

5
TODO
View File

@ -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

View File

@ -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

View File

@ -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