]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/inline.pm
inline: Ignore parent dirs when sorting pages by title.
[ikiwiki.git] / IkiWiki / Plugin / inline.pm
index 3ca4fccdf51307be98b635348e6cb21074250298..1a6c7cfcd580ac35b755a8a3a446c77521aad0e1 100644 (file)
@@ -28,7 +28,6 @@ sub import { #{{{
        # pings interrupting page builds.
        hook(type => "change", id => "inline", 
                call => \&IkiWiki::pingurl);
-
 } # }}}
 
 sub getopt () { #{{{
@@ -48,39 +47,42 @@ sub getopt () { #{{{
 
 sub getsetup () { #{{{
        return
+               plugin => {
+                       safe => 1,
+                       rebuild => undef,
+               },
                rss => {
                        type => "boolean",
-                       default => 0,
-                       description => "enable rss feeds by default",
+                       example => 0,
+                       description => "enable rss feeds by default?",
                        safe => 1,
                        rebuild => 1,
                },
                atom => {
                        type => "boolean",
-                       default => 0,
-                       description => "enable atom feeds by default",
+                       example => 0,
+                       description => "enable atom feeds by default?",
                        safe => 1,
                        rebuild => 1,
                },
                allowrss => {
                        type => "boolean",
-                       default => 0,
-                       description => "allow rss feeds to be used",
+                       example => 0,
+                       description => "allow rss feeds to be used?",
                        safe => 1,
                        rebuild => 1,
                },
                allowatom => {
                        type => "boolean",
-                       default => 0,
-                       description => "allow atom feeds to be used",
+                       example => 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",
+                       description => "urls to ping (using XML-RPC) on feed update",
                        safe => 1,
                        rebuild => 0,
                },
@@ -96,6 +98,9 @@ sub checkconfig () { #{{{
        if ($config{atom}) {
                push @{$config{wiki_file_prune_regexps}}, qr/\.atom$/;
        }
+       if (! exists $config{pingurl}) {
+               $config{pingurl}=[];
+       }
 } #}}}
 
 sub format (@) { #{{{
@@ -181,7 +186,7 @@ sub preprocess_inline (@) { #{{{
        }
 
        if (exists $params{sort} && $params{sort} eq 'title') {
-               @list=sort @list;
+               @list=sort { pagetitle(basename($a)) cmp pagetitle(basename($b)) } @list;
        }
        elsif (exists $params{sort} && $params{sort} eq 'mtime') {
                @list=sort { $pagemtime{$b} <=> $pagemtime{$a} } @list;
@@ -246,7 +251,7 @@ sub preprocess_inline (@) { #{{{
        my $atomurl=basename(atompage($params{destpage}).$feednum) if $feeds && $atom;
        my $ret="";
 
-       if ($config{cgiurl} && ! $params{preview} && (exists $params{rootpage} ||
+       if (length $config{cgiurl} && ! $params{preview} && (exists $params{rootpage} ||
                        (exists $params{postform} && yesno($params{postform})))) {
                # Add a blog post form, with feed buttons.
                my $formtemplate=template("blogpost.tmpl", blind_cache => 1);