clean rss content
parent
dea5cd3245
commit
70e98b121f
5
TODO
5
TODO
|
@ -1,4 +1,4 @@
|
||||||
* Todo [8/15]
|
* Todo [9/17]
|
||||||
- [X] switch to creation dates
|
- [X] switch to creation dates
|
||||||
- [X] hide drafts in categories, but compile them anyway
|
- [X] hide drafts in categories, but compile them anyway
|
||||||
- [X] better rss feed (automatic items based on dates, changelog)
|
- [X] better rss feed (automatic items based on dates, changelog)
|
||||||
|
@ -14,4 +14,5 @@
|
||||||
- [ ] search bar prettier
|
- [ ] search bar prettier
|
||||||
- [ ] imply all_sites without -s
|
- [ ] imply all_sites without -s
|
||||||
- [ ] next_prev for first page float broken
|
- [ ] 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
|
||||||
|
|
|
@ -30,7 +30,7 @@ def rss_feed
|
||||||
i.title = "#{item[:title]}"
|
i.title = "#{item[:title]}"
|
||||||
i.link = "#{@site.url}" + item.path
|
i.link = "#{@site.url}" + item.path
|
||||||
i.date = item[:date].to_time
|
i.date = item[:date].to_time
|
||||||
i.description = item.compiled_content
|
i.description = tidy item.compiled_content
|
||||||
end
|
end
|
||||||
|
|
||||||
# mod date is newest article / entry in log
|
# mod date is newest article / entry in log
|
||||||
|
|
19
lib/tidy.rb
19
lib/tidy.rb
|
@ -8,12 +8,17 @@ require 'tidy_ffi'
|
||||||
class TidyFilter < Nanoc::Filter
|
class TidyFilter < Nanoc::Filter
|
||||||
identifier :tidy
|
identifier :tidy
|
||||||
def run(content, params={})
|
def run(content, params={})
|
||||||
TidyFFI::Tidy.new(content,
|
tidy content
|
||||||
:wrap => 80,
|
|
||||||
:tidy_mark => false,
|
|
||||||
:indent => 1,
|
|
||||||
:char_encoding => "utf8",
|
|
||||||
:hide_comments => true,
|
|
||||||
).clean
|
|
||||||
end
|
end
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue