Changeset 311
- Timestamp:
- 03/05/06 09:58:58
- Files:
-
- trunk/plagger/assets/plugins/publish-planet/default/static/css/screen.css (modified) (1 diff)
- trunk/plagger/assets/plugins/publish-planet/default/template/index.tt (modified) (1 diff)
- trunk/plagger/examples/planet.yaml (modified) (3 diffs)
- trunk/plagger/lib/Plagger/Plugin/Publish/Planet.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/assets/plugins/publish-planet/default/static/css/screen.css
r300 r311 1 1 body { 2 background-color: blue; 2 background-color: #ccc; 3 color: black; 4 font-family: Verdana, sans-serif; 3 5 } 6 7 #feed-title { 8 font-size: xx-large; 9 text-align: center; 10 border: 1px solid #aaa; 11 margin: 1em; 12 padding: 1em; 13 background-color: white; 14 } 15 16 .entry { 17 border: 1px solid #aaa; 18 margin: 2em; 19 padding: 1em; 20 background-color: white; 21 } 22 23 .entry-title { 24 display: block; 25 font-weight: bold; 26 margin-bottom: 1em; 27 font-size: large; 28 } trunk/plagger/assets/plugins/publish-planet/default/template/index.tt
r300 r311 4 4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 5 5 <head> 6 <link rel="alternate" type="application/atom+xml" title="Planet [% title %]" href="smartfeed_all.atom" /> 6 <link rel="alternate" type="application/atom+xml" title="Atom: [% feed.title %]" href="smartfeed_all.atom" /> 7 <link rel="alternate" type="application/rss+xml" title="RSS: [% feed.title %]" href="smartfeed_all.rss" /> 7 8 <link rel="stylesheet" type="text/css" href="css/screen.css" /> 8 <title> Planet [%title %]</title>9 <title>[% feed.title %]</title> 9 10 </head> 10 11 <body> 11 < h1 "feed-title">[% feed.title %]</h1>12 <div id="feed-title">[% feed.title %]</div> 12 13 13 [% FOREACH item IN feed.entries %] 14 <div class="item"> 15 <div class="item-header"> 16 <a class="item-link item-title" href="[% (item.link || item.id) | html %]">[% item.title | html %]</a> 17 [% IF item.author %] 18 <span class="item-by-line"> 19 by <span class="item-author">[% item.author | html %]</span> 14 [% FOREACH entry IN feed.entries %] 15 <div class="entry"> 16 <div class="entry-header"> 17 <div class="entry-title"> 18 [% IF entry.source.title %] 19 <a class="entry-source-link" href="[% entry.source.link | html %]">[% entry.source.title | html %]</a>: 20 [% END %] 21 <a class="entry-link" href="[% (entry.link || entry.id) | html %]">[% entry.title | html %]</a> 22 </div> 23 [% IF entry.author %] 24 <span class="entry-by-line"> 25 by <span class="entry-author">[% entry.author | html %]</span> 20 26 </span> 21 27 [% END %] 22 [% IF item.tags.size %]23 <span class=" item-tags">28 [% IF entry.tags.size %] 29 <span class="entry-tags"> 24 30 on 25 <span class=" item-tag">26 [% item.tags.join('</span>, <span class="item-tag">') %]31 <span class="entry-tag"> 32 [% entry.tags.join('</span>, <span class="entry-tag">') %] 27 33 </span> 28 34 [% END %] 29 35 </div> 30 [% IF item.body %]31 <div class=" item-body">32 [% item.body %]36 [% IF entry.body %] 37 <div class="entry-body"> 38 [% entry.body %] 33 39 </div> 34 40 [% END %] 35 <div class=" item-footer">36 [% IF item.date %]37 <span class=" item-posted">41 <div class="entry-footer"> 42 [% IF entry.date %] 43 <span class="entry-posted"> 38 44 Posted on 39 <span class=" item-post-date">[% item.date.format('Mail') %]</span>45 <span class="entry-post-date">[% entry.date.format('Mail') %]</span> 40 46 </span> 41 47 [% END %] 42 <a class="item-permalink" href="[% entry.permalink | html %]">permalink</a> 43 <a class="item-link item-title" href="[% feed.link | html %]">[% feed.title | html %]</a> 44 [% FOREACH widget = item.widgets %] 45 <span class="item-widget">[% widget.html(item) %]</span> 48 <a class="entry-permalink" href="[% entry.permalink | html %]">permalink</a> 49 [% FOREACH widget = entry.widgets %] 50 <span class="entry-widget">[% widget.html(item) %]</span> 46 51 [% END %] 47 52 </div> trunk/plagger/examples/planet.yaml
r292 r311 7 7 config: 8 8 feed: 9 - url: http://caseywest.com/journal/index.rdf 10 - url: http://del.icio.us/rss/popular 11 - url: http://feeds.technorati.com/feed/posts/tag/miyagawa 9 - url: http://bulknews.typepad.com/blog/index.rdf 10 - url: http://engadget.com/rss.xml 12 11 13 12 - module: Aggregator::Simple 14 13 15 14 - module: SmartFeed::All 15 config: 16 title: Planet Plagger 16 17 17 18 - module: Publish::Planet … … 20 21 config: 21 22 dir: /tmp/planet 22 skin: planet23 skin: default 23 24 24 25 - module: Publish::Feed … … 28 29 dir: /tmp/planet 29 30 31 - module: Publish::Feed 32 rule: 33 expression: $args->{feed}->id eq 'smartfeed:all' 34 config: 35 dir: /tmp/planet 36 format: RSS trunk/plagger/lib/Plagger/Plugin/Publish/Planet.pm
r301 r311 4 4 5 5 use File::Copy::Recursive qw[rcopy]; 6 use HTML::Tidy; 7 use HTML::Scrubber; 6 8 7 9 our $VERSION = '0.01'; … … 21 23 $context->error("Publish::Planet requires SmartFeed::All to run."); 22 24 } 25 26 $self->_sanitize_entries($context, $feed); 23 27 24 28 $self->_write_index( … … 43 47 $tt->process("$skin/template/index.tt", { 44 48 feed => $feed, 45 title => $self->conf->{title},46 49 }, \my $out) or $context->error($tt->error); 47 50 $out; 51 } 52 53 sub _sanitize_entries { 54 my ($self, $context, $feed) = shift; 55 56 foreach my $entry (@{$feed->{entries}}) { 57 $entry->{body} = HTML::Tidy->new->clean($entry->{body}); 58 $entry->{body} = HTML::Scrubber->new->scrub($entry->{body}); 59 } 48 60 } 49 61
