]> 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 0fe0bd2e108a444b6b85c2ded93840f10e4fd2fc..942df6f89cf67381b66cea89ada37bba1f419620 100644 (file)
@@ -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.