From: joey Date: Sat, 14 Apr 2007 20:58:02 +0000 (+0000) Subject: * Add feedshow parameter to inline, which can be useful for eg, removing X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/commitdiff_plain/e855e30d01796253a77da4531fcd1f896d9f117a?ds=sidebyside * Add feedshow parameter to inline, which can be useful for eg, removing old posts from feeds when permalinks change. --- diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 452fdd267..417eec8f3 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -222,6 +222,9 @@ sub preprocess_inline (@) { #{{{ if (exists $params{feedshow} && @list > $params{feedshow}) { @list=@list[0..$params{feedshow} - 1]; } + if (exists $params{feedpages}) { + @list=grep { pagespec_match($_, $params{feedpages}, $params{page}) } @list; + } if ($rss) { my $rssp=rsspage($params{page}); diff --git a/debian/changelog b/debian/changelog index 93f2de366..20e92c43c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -32,8 +32,10 @@ ikiwiki (1.50) UNRELEASED; urgency=low * Patch from Tuomov to link to the directory in feeds when usedirs is in effect. Note that this changes permalinks, so if you are already using usedirs you'll have to deal with that on upgrade to this version. + * Add feedshow parameter to inline, which can be useful for eg, removing + old posts from feeds when permalinks change. - -- Joey Hess Sat, 14 Apr 2007 16:11:30 -0400 + -- Joey Hess Sat, 14 Apr 2007 16:52:46 -0400 ikiwiki (1.49) unstable; urgency=low diff --git a/doc/plugins/inline.mdwn b/doc/plugins/inline.mdwn index 7c8f54d11..44e29d0c5 100644 --- a/doc/plugins/inline.mdwn +++ b/doc/plugins/inline.mdwn @@ -17,10 +17,6 @@ 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 @@ -56,3 +52,11 @@ directive: sort newest created pages first. Setting it to "title" will sort pages by title, and "mtime" sorts most recently modified pages first. * `reverse` - If set to "yes", causes the sort order to be reversed. +* `feedpages` - A [[PageSpec]] of inlined pages to include in the rss/atom + feeds. The default is the same as the `pages` value above, and only pages + matches by that value are included, but some of those can be excluded by + specifying a tighter [[PageSpec]] here. +* `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. diff --git a/doc/tips/howto_avoid_flooding_aggregators.mdwn b/doc/tips/howto_avoid_flooding_aggregators.mdwn index d432464fc..355e0e6a7 100644 --- a/doc/tips/howto_avoid_flooding_aggregators.mdwn +++ b/doc/tips/howto_avoid_flooding_aggregators.mdwn @@ -15,11 +15,11 @@ This can happen in a lot of situations: To avoid annoying readers in these situations, it's a good idea to remove and existing items from your blog's news feed. That way only new items will -show up in the aggregator. The best way to do this is currently to modify -the [[PageSpec]] for your [[blog]] and add a condition such as: +show up in the aggregator. The best way to do this is to add a `feedpages` +parameter to the `inline` directive for your blog, with a condition such as: - and created_after(blog/posts/old_post) + feedpages=created_after(blog/posts/old_post) Where "old_post" is the name of the last post you made to the blog before -making the change. This will limit the feed to only newer posts (the older -posts will still be available in the archives). +making the change. This will limit the feed to only newer posts, while stil +displaying the old posts in the blog page. diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index cd5e2ac19..6869f4020 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-04-14 16:40-0400\n" +"POT-Creation-Date: 2007-04-14 16:56-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -173,7 +173,7 @@ msgstr "" msgid "Discussion" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:399 +#: ../IkiWiki/Plugin/inline.pm:402 msgid "RPC::XML::Client not found, not pinging" msgstr ""