]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/inline.pm
403 response may be a "not found" too
[git.ikiwiki.info.git] / IkiWiki / Plugin / inline.pm
index 748e02df418370e10200e32428b649c5d86e75e6..942df6f89cf67381b66cea89ada37bba1f419620 100644 (file)
@@ -216,9 +216,9 @@ sub preprocess_inline (@) {
                        $num+=$params{skip};
                }
 
-               @list = use_pagespec($params{page}, $params{pages},
+               @list = pagespec_match_list($params{page}, $params{pages},
                        deptype => deptype($quick ? "presence" : "content"),
-                       limit => sub { $_[0] ne $params{page} },
+                       filter => sub { $_[0] eq $params{page} },
                        sort => exists $params{sort} ? $params{sort} : "age",
                        reverse => yesno($params{reverse}),
                        num => $num,
@@ -245,8 +245,11 @@ sub preprocess_inline (@) {
        }
 
        if ($feeds && exists $params{feedpages}) {
-               @feedlist = use_pagespec($params{page}, $params{feedpages},
-                       list => \@feedlist);
+               @feedlist = pagespec_match_list(
+                       $params{page}, "($params{pages}) and ($params{feedpages})",
+                       deptype => deptype($quick ? "presence" : "content"),
+                       list => \@feedlist,
+               );
        }
 
        my ($feedbase, $feednum);
@@ -329,12 +332,13 @@ sub preprocess_inline (@) {
                        error sprintf(gettext("nonexistant template %s"), $params{template});
                }
                my $template=HTML::Template->new(@params) unless $raw;
+               my $needcontent=$raw || (!($archive && $quick) && $template->query(name => 'content'));
        
                foreach my $page (@list) {
                        my $file = $pagesources{$page};
                        my $type = pagetype($file);
                        if (! $raw || ($raw && ! defined $type)) {
-                               unless ($archive && $quick) {
+                               if ($needcontent) {
                                        # Get the content before populating the
                                        # template, since getting the content uses
                                        # the same template if inlines are nested.