* inline: Add new `allowrss` and `allowatom` config options. These can be

used if you want a wiki that doesn't default to generating rss or atom
  feeds, but that does allow them to be turned on for specific blogs.
master
Joey Hess 2008-02-04 18:36:50 -05:00
parent f7c575bd30
commit bf522a347f
6 changed files with 38 additions and 14 deletions

View File

@ -68,6 +68,8 @@ sub defaultconfig () { #{{{
diffurl => '',
rss => 0,
atom => 0,
allowrss => 0,
allowatom => 0,
discussion => 1,
rebuild => 0,
refresh => 0,

View File

@ -34,6 +34,8 @@ sub getopt () { #{{{
GetOptions(
"rss!" => \$config{rss},
"atom!" => \$config{atom},
"allowrss!" => \$config{allowrss},
"allowatom!" => \$config{allowatom},
);
}
@ -91,8 +93,8 @@ sub preprocess_inline (@) { #{{{
}
my $raw=yesno($params{raw});
my $archive=yesno($params{archive});
my $rss=($config{rss} && exists $params{rss}) ? yesno($params{rss}) : $config{rss};
my $atom=($config{atom} && exists $params{atom}) ? yesno($params{atom}) : $config{atom};
my $rss=(($config{rss} || $config{allowrss}) && exists $params{rss}) ? yesno($params{rss}) : $config{rss};
my $atom=(($config{atom} || $config{allowatom}) && exists $params{atom}) ? yesno($params{atom}) : $config{atom};
my $quick=exists $params{quick} ? yesno($params{quick}) : 0;
my $feeds=exists $params{feeds} ? yesno($params{feeds}) : !$quick;
my $feedonly=yesno($params{feedonly});

3
debian/changelog vendored
View File

@ -33,6 +33,9 @@ ikiwiki (2.31) UNRELEASED; urgency=low
and if will_render isn't called its security checks will get upset
when the page is saved. Thanks to Edward Betts for his help tracking this
tricky bug down.
* inline: Add new `allowrss` and `allowatom` config options. These can be
used if you want a wiki that doesn't default to generating rss or atom
feeds, but that does allow them to be turned on for specific blogs.
-- Joey Hess <joeyh@debian.org> Sat, 02 Feb 2008 23:36:31 -0500

View File

@ -92,10 +92,13 @@ use IkiWiki::Setup::Standard {
#},
],
# Generate rss feeds for blogs?
rss => 1,
# Generate atom feeds for blogs?
atom => 1,
# Default to generating rss feeds for blogs?
#rss => 1,
# Default to generating atom feeds for blogs?
#atom => 1,
# Allow generating feeds even if not generated by default?
#allowrss => 1,
#allowatom => 1,
# Urls to ping with XML-RPC when rss feeds are updated
#pingurl => [qw{http://rpc.technorati.com/rpc/ping}],
# Include discussion links on all pages?

View File

@ -52,10 +52,12 @@ directive:
Set to 0 to show all matching pages.
* `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
configured to use rss feeds, set to "no" to disable.
* `atom` - controls generation of an atom feed. On by default if the wiki is
configured to use atom feeds, set to "no" to disable.
* `rss` - controls generation of an rss feed. If the wiki is configured to
generate tss feeds by default, set to "no" to disable. If the wiki is
configured to `allowrss`, set to "yes" to enable.
* `atom` - controls generation of an atom feed. If the wiki is configured to
generate atom feeds by default, set to "no" to disable. If the wiki is
configured to `allowatom`, set to "yes" to enable.
* `feeds` - controls generation of all types of feeds. Set to "no" to
disable generating any feeds.
* `postform` - Set to "yes" to enables a form to post new pages to a [[blog]].

View File

@ -153,13 +153,25 @@ configuration options of their own.
* --rss, --norss
If rss is set, ikiwiki will generate RSS feeds for pages that inline
a [[ikiwiki/blog]].
If rss is set, ikiwiki will default to generating RSS feeds for pages
that inline a [[ikiwiki/blog]].
* --allowrss
If allowrss is set, and rss is not set, ikiwiki will not default to
generating RSS feeds, but setting `rss=yes` in the blog can override
this default and generate a feed.
* --atom, --noatom
If atom is set, ikiwiki will generate Atom feeds for pages that inline
a [[ikiwiki/blog]].
If atom is set, ikiwiki will default to generating Atom feeds for pages
that inline a [[ikiwiki/blog]].
* --allowatom
If allowatom is set, and rss is not set, ikiwiki will not default to
generating Atom feeds, but setting `atom=yes` in the blog can override
this default and generate a feed.
* --pingurl URL