* Patch from James Westby to allow a description to be set for rss feeds.

master
joey 2006-08-26 17:36:46 +00:00
parent d214af5cfb
commit 38ce4c3cef
5 changed files with 17 additions and 4 deletions

View File

@ -40,6 +40,12 @@ sub preprocess_inline (@) { #{{{
if (! exists $params{show} && ! $archive) {
$params{show}=10;
}
my $desc;
if (exists $params{description}) {
$desc = $params{description}
} else {
$desc = $config{wikiname};
}
my @list;
foreach my $page (keys %pagesources) {
@ -124,7 +130,7 @@ sub preprocess_inline (@) { #{{{
# only supports listing one file per page.
if ($config{rss} && $rss) {
writefile(rsspage($params{page}), $config{destdir},
genrss($params{page}, @list));
genrss($desc, $params{page}, @list));
$toping{$params{page}}=1 unless $config{rebuild};
}
@ -178,7 +184,8 @@ sub rsspage ($) { #{{{
return $page.".rss";
} #}}}
sub genrss ($@) { #{{{
sub genrss ($$@) { #{{{
my $desc = shift;
my $page=shift;
my @pages=@_;
@ -213,6 +220,7 @@ sub genrss ($@) { #{{{
wikiname => $config{wikiname},
pageurl => $url,
content => $content,
rssdesc => $desc,
);
run_hooks(pagetemplate => sub {
shift->(page => $page, destpage => $page,

3
debian/changelog vendored
View File

@ -31,8 +31,9 @@ ikiwiki (1.22) UNRELEASED; urgency=low
* Support running "perl Makefile.PL PREFIX=foo" to build ikiwiki to run
from a different directory.
* Generalised preprocesser loop protection code.
* Patch from James Westby to allow a description to be set for rss feeds.
-- Joey Hess <joeyh@debian.org> Fri, 25 Aug 2006 14:48:36 -0400
-- Joey Hess <joeyh@debian.org> Sat, 26 Aug 2006 13:26:22 -0400
ikiwiki (1.21) unstable; urgency=low

View File

@ -27,3 +27,5 @@ directive:
if raw is set to "yes", the page will be included raw, without additional
markup around it, as if it were a literal part of the source of the
inlining page.
* `description` - Sets the description of the rss feed if one is generated.
Defaults to the name of the wiki.

View File

@ -31,3 +31,5 @@ I must have done something wrong. I'll have a look at implementing the descripti
Thanks. -- JamesWestby
My patch can be found at <http://jameswestby.net/scratch/blog-desc.diff> -- JamesWestby
Thanks, [[todo/done]] --[[Joey]]

View File

@ -4,7 +4,7 @@
<channel>
<title><TMPL_VAR TITLE ESCAPE=HTML></title>
<link><TMPL_VAR PAGEURL></link>
<description><TMPL_VAR WIKINAME ESCAPE=HTML></description>
<description><TMPL_VAR RSSDESC ESCAPE=HTML></description>
<TMPL_VAR CONTENT>
</channel>
</rss>