]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Render.pm
add blog post template
[ikiwiki.git] / IkiWiki / Render.pm
index a981dcb24979da75d8f83923b9d629230a3dc1a2..4e2caa6cef31435bc026bf70f9b7573d406e46c1 100644 (file)
@@ -160,12 +160,22 @@ sub postprocess_html_inline { #{{{
        }
        $inlinepages{$parentpage}=$params{pages};
        
+       my $ret="";
+       
+       if (exists $params{rootpage}) {
+               my $formtemplate=HTML::Template->new(blind_cache => 1,
+                       filename => "$config{templatedir}/blogpost.tmpl");
+               $formtemplate->param(cgiurl => $config{cgiurl});
+               $formtemplate->param(rootpage => $params{rootpage});
+               my $form=$formtemplate->output;
+               $ret.=$form;
+       }
+       
        my $template=HTML::Template->new(blind_cache => 1,
                filename => (($params{archive} eq "no") 
                                ? "$config{templatedir}/inlinepage.tmpl"
                                : "$config{templatedir}/inlinepagetitle.tmpl"));
        
-       my $ret="";
        foreach my $page (blog_list($params{pages}, $params{show})) {
                next if $page eq $parentpage;
                $template->param(pagelink => htmllink($parentpage, $page));
@@ -463,20 +473,24 @@ FILE:             foreach my $file (@files) {
        # problem is the backlinks could be wrong in the first pass render
        # above
        if (%rendered || @del) {
+               foreach my $f (@files) {
+                       my $p=pagename($f);
+                       if (exists $inlinepages{$p}) {
+                               foreach my $file (keys %rendered, @del) {
+                                       my $page=pagename($file);
+                                       if (globlist_match($page, $inlinepages{$p})) {
+                                               debug("rendering $f, which inlines $page");
+                                               render($f);
+                                               last;
+                                       }
+                               }
+                       }
+               }
+               
                my %linkchanged;
                foreach my $file (keys %rendered, @del) {
                        my $page=pagename($file);
                        
-                       foreach my $f (@files) {
-                               my $p=pagename($f);
-                               if (exists $inlinepages{$p} && 
-                                   globlist_match($page, $inlinepages{$p})) {
-                                       debug("rendering $f, which inlines $page");
-                                       render($f);
-                                       next;
-                               }
-                       }
-                       
                        if (exists $links{$page}) {
                                foreach my $link (map { bestlink($page, $_) } @{$links{$page}}) {
                                        if (length $link &&