]> 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 815a3783841b7b1017d82d51d754041f1be13f34..942df6f89cf67381b66cea89ada37bba1f419620 100644 (file)
@@ -218,7 +218,7 @@ sub preprocess_inline (@) {
 
                @list = pagespec_match_list($params{page}, $params{pages},
                        deptype => deptype($quick ? "presence" : "content"),
 
                @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,
                        sort => exists $params{sort} ? $params{sort} : "age",
                        reverse => yesno($params{reverse}),
                        num => $num,
@@ -332,12 +332,13 @@ sub preprocess_inline (@) {
                        error sprintf(gettext("nonexistant template %s"), $params{template});
                }
                my $template=HTML::Template->new(@params) unless $raw;
                        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)) {
        
                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.
                                        # Get the content before populating the
                                        # template, since getting the content uses
                                        # the same template if inlines are nested.