X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/2c05a34be17c805d929f0ad563acf857eba1d46b..bf6198baf3d8ca546ff2c6651f78152f3578792a:/IkiWiki/Plugin/inline.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 5517e3c94..3ca4fccdf 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -15,6 +15,7 @@ my $nested=0; sub import { #{{{ hook(type => "getopt", id => "inline", call => \&getopt); + hook(type => "getsetup", id => "inline", call => \&getsetup); hook(type => "checkconfig", id => "inline", call => \&checkconfig); hook(type => "sessioncgi", id => "inline", call => \&sessioncgi); hook(type => "preprocess", id => "inline", @@ -39,8 +40,51 @@ sub getopt () { #{{{ "atom!" => \$config{atom}, "allowrss!" => \$config{allowrss}, "allowatom!" => \$config{allowatom}, + "pingurl=s" => sub { + push @{$config{pingurl}}, $_[1]; + }, ); -} +} #}}} + +sub getsetup () { #{{{ + return + rss => { + type => "boolean", + default => 0, + description => "enable rss feeds by default", + safe => 1, + rebuild => 1, + }, + atom => { + type => "boolean", + default => 0, + description => "enable atom feeds by default", + safe => 1, + rebuild => 1, + }, + allowrss => { + type => "boolean", + default => 0, + description => "allow rss feeds to be used", + safe => 1, + rebuild => 1, + }, + allowatom => { + type => "boolean", + default => 0, + description => "allow atom feeds to be used", + safe => 1, + rebuild => 1, + }, + pingurl => { + type => "string", + default => "", + example => "http://rpc.technorati.com/rpc/ping", + description => "urls to ping (using XMP-RPC) on feed update", + safe => 1, + rebuild => 0, + }, +} #}}} sub checkconfig () { #{{{ if (($config{rss} || $config{atom}) && ! length $config{url}) { @@ -419,13 +463,13 @@ sub genfeed ($$$$$@) { #{{{ my $page=shift; my @pages=@_; - my $url=URI->new(encode_utf8($config{url}."/".urlto($page,""))); + my $url=URI->new(encode_utf8(urlto($page,"",1))); my $itemtemplate=template($feedtype."item.tmpl", blind_cache => 1); my $content=""; my $lasttime = 0; foreach my $p (@pages) { - my $u=URI->new(encode_utf8($config{url}."/".urlto($p, ""))); + my $u=URI->new(encode_utf8(urlto($p, "", 1))); my $pcontent = absolute_urls(get_inline_content($p, $page), $url); $itemtemplate->param( @@ -521,7 +565,7 @@ sub pingurl (@) { #{{{ foreach my $page (keys %toping) { my $title=pagetitle(basename($page), 0); - my $url="$config{url}/".urlto($page, ""); + my $url=urlto($page, "", 1); foreach my $pingurl (@{$config{pingurl}}) { debug("Pinging $pingurl for $page"); eval {