summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-26 17:36:46 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-26 17:36:46 +0000
commit38ce4c3cef71518610cb934fde171e2d4aeff99e (patch)
tree5671c2cd337f44f872b5d14f4588ef69c29d8407
parentd214af5cfb19956920784b266f5050a28d4c0fa4 (diff)
* Patch from James Westby to allow a description to be set for rss feeds.
-rw-r--r--IkiWiki/Plugin/inline.pm12
-rw-r--r--debian/changelog3
-rw-r--r--doc/plugins/inline.mdwn2
-rw-r--r--doc/todo/rss_title_description.mdwn2
-rw-r--r--templates/rsspage.tmpl2
5 files changed, 17 insertions, 4 deletions
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index e7ec238ed..fe7dde14c 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -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,
diff --git a/debian/changelog b/debian/changelog
index 875d4f9a9..e36ad1c8b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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
diff --git a/doc/plugins/inline.mdwn b/doc/plugins/inline.mdwn
index d2d13e5fc..f4110fe45 100644
--- a/doc/plugins/inline.mdwn
+++ b/doc/plugins/inline.mdwn
@@ -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.
diff --git a/doc/todo/rss_title_description.mdwn b/doc/todo/rss_title_description.mdwn
index 59d1d5da9..0fb3e954e 100644
--- a/doc/todo/rss_title_description.mdwn
+++ b/doc/todo/rss_title_description.mdwn
@@ -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]]
diff --git a/templates/rsspage.tmpl b/templates/rsspage.tmpl
index d78f94edf..4ec143903 100644
--- a/templates/rsspage.tmpl
+++ b/templates/rsspage.tmpl
@@ -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>