mirror of
https://github.com/fmap/muflax65ngodyewp.onion
synced 2025-01-05 12:35:06 +01:00
clean rss content
This commit is contained in:
parent
dea5cd3245
commit
70e98b121f
5
TODO
5
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
|
||||
|
|
|
@ -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
|
||||
|
|
19
lib/tidy.rb
19
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
|
||||
|
|
Loading…
Reference in a new issue