]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Add feedshow option to allow reducing the number of items included in
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Mon, 5 Feb 2007 21:54:36 +0000 (21:54 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Mon, 5 Feb 2007 21:54:36 +0000 (21:54 +0000)
  an rss or atom feed.

IkiWiki/Plugin/inline.pm
debian/changelog
doc/examples/blog/posts.mdwn
doc/plugins/inline.mdwn
doc/todo/Shorter_feeds.mdwn

index ec1cf0970dcdc21f12beba82e27c9bc8ed8aa288..06b74b3fab0442654e6ecd25772cf19efd0bab5f 100644 (file)
@@ -190,19 +190,25 @@ sub preprocess_inline (@) { #{{{
                }
        }
        
-       if ($feeds && $rss) {
-               will_render($params{page}, rsspage($params{page}));
-               writefile(rsspage($params{page}), $config{destdir},
-                       genfeed("rss", $rssurl, $desc, $params{page}, @list));
-               $toping{$params{page}}=1 unless $config{rebuild};
-               $feedlinks{$params{destpage}}=qq{<link rel="alternate" type="application/rss+xml" title="RSS" href="$rssurl" />};
-       }
-       if ($feeds && $atom) {
-               will_render($params{page}, atompage($params{page}));
-               writefile(atompage($params{page}), $config{destdir},
-                       genfeed("atom", $atomurl, $desc, $params{page}, @list));
-               $toping{$params{page}}=1 unless $config{rebuild};
-               $feedlinks{$params{destpage}}=qq{<link rel="alternate" type="application/atom+xml" title="Atom" href="$atomurl" />};
+       if ($feeds) {
+               if (exists $params{feedshow} && @list > $params{feedshow}) {
+                       @list=@list[0..$params{feedshow} - 1];
+               }
+       
+               if ($rss) {
+                       will_render($params{page}, rsspage($params{page}));
+                       writefile(rsspage($params{page}), $config{destdir},
+                               genfeed("rss", $rssurl, $desc, $params{page}, @list));
+                       $toping{$params{page}}=1 unless $config{rebuild};
+                       $feedlinks{$params{destpage}}=qq{<link rel="alternate" type="application/rss+xml" title="RSS" href="$rssurl" />};
+               }
+               if ($atom) {
+                       will_render($params{page}, atompage($params{page}));
+                       writefile(atompage($params{page}), $config{destdir},
+                               genfeed("atom", $atomurl, $desc, $params{page}, @list));
+                       $toping{$params{page}}=1 unless $config{rebuild};
+                       $feedlinks{$params{destpage}}=qq{<link rel="alternate" type="application/atom+xml" title="Atom" href="$atomurl" />};
+               }
        }
        
        return $ret;
index 4c45fbea77cbbadd6185010e93780b060017b8e9..fb3afc21e50b6054a87e47b7214082530564c9a3 100644 (file)
@@ -15,8 +15,10 @@ ikiwiki (1.42) UNRELEASED; urgency=low
   * Lots of CGI code reorg and cleanup.
   * Avoid using lots of memory when copying large non-html files.
     Yes, you can keep videos in the wiki..
+  * Add feedshow option to allow reducing the number of items included in
+    an rss or atom feed.
 
- -- Joey Hess <joeyh@debian.org>  Fri,  2 Feb 2007 21:59:04 -0500
+ -- Joey Hess <joeyh@debian.org>  Mon,  5 Feb 2007 16:51:10 -0500
 
 ikiwiki (1.41) unstable; urgency=low
 
index e4b053d8f3c5436f51db821fd0ccc9f3b231255f..f5b128df00a7890c773cb344c1659fc3de44120e 100644 (file)
@@ -1,3 +1,3 @@
 Here is a full list of posts to my [[blog|index]].
 
-[[inline pages="*blog/posts/* and !*/Discussion" archive=yes quick=yes]]
+[[inline pages="*blog/posts/* and !*/Discussion" archive=yes feedshow=10 quick=yes]]
index cfea8006e0262b81360b815c45d440064baf82e0..cd76fd2864aafc0b7ce0dd33ef3c96b86f611937 100644 (file)
@@ -18,6 +18,10 @@ directive:
 * `show` - Specify the maximum number of matching pages to inline.
   Default is 10, unless archiving, when the default is to show all.
   Set to 0 to show all matching pages.
+* `feedshow` - Specify the maximum number of matching pages to include in
+  the rss/atom feeds. The default is the same as the `show` value above,
+  and it cannot be larger than that value, but can be set to a smaller
+  value to avoid producing excessively large feed files.
 * `skip` - Specify a number of pages to skip displaying. Can be useful
   to produce a feed that only shows archived pages.
 * `rss` - controls generation of an rss feed. On by default if the wiki is
index 0966bc216916ebf0b265fa52f64f9d9a24cd268a..2e0b0fab9f0283e01a354c87db0561f2e13e0815 100644 (file)
@@ -1,4 +1,11 @@
-It should be possible to control the number of items included in a feed independently of the number of items included on the page (the latter, however, possibly setting an upper limit). This would be particularly useful on archive pages providing a feed. Presently the feed grows huge, if the archive page has no limit on the entries listed on it (as in the list of [all entries][ionfaq] in the Ion FAQ). An alternative useful filter would be filtering by the age of the page.
+It should be possible to control the number of items included in a feed
+independently of the number of items included on the page (the latter,
+however, possibly setting an upper limit). This would be particularly
+useful on archive pages providing a feed. Presently the feed grows huge, if
+the archive page has no limit on the entries listed on it (as in the list
+of [all entries][ionfaq] in the Ion FAQ). An alternative useful filter
+would be filtering by the age of the page.
 
   [ionfaq]: http://iki.fi/tuomov/ion/faq/entries.html
 
+> [[todo/Done]], option name is `feedshow` --[[Joey]]