]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/inline.pm
move feedpages application up
[ikiwiki.git] / IkiWiki / Plugin / inline.pm
index 536d7cd027b87543d29fe7ebe2e132aed990f695..0c8f503847aeb54cc0f08b68316673561c7ae936 100644 (file)
@@ -201,7 +201,7 @@ sub preprocess_inline (@) { #{{{
                @list=sort { $pagectime{$b} <=> $pagectime{$a} } @list;
        }
        else {
-               return sprintf(gettext("unknown sort type %s"), $params{sort});
+               error sprintf(gettext("unknown sort type %s"), $params{sort});
        }
 
        if (yesno($params{reverse})) {
@@ -232,6 +232,10 @@ sub preprocess_inline (@) { #{{{
        # that if they are removed or otherwise changed, the inline will be
        # sure to be updated.
        add_depends($params{page}, join(" or ", $#list >= $#feedlist ? @list : @feedlist));
+       
+       if ($feeds && exists $params{feedpages}) {
+               @feedlist=grep { pagespec_match($_, $params{feedpages}, location => $params{page}) } @feedlist;
+       }
 
        my $feednum="";
 
@@ -298,7 +302,7 @@ sub preprocess_inline (@) { #{{{
                require HTML::Template;
                my @params=IkiWiki::template_params($params{template}.".tmpl", blind_cache => 1);
                if (! @params) {
-                       return sprintf(gettext("nonexistant template %s"), $params{template});
+                       error sprintf(gettext("nonexistant template %s"), $params{template});
                }
                my $template=HTML::Template->new(@params) unless $raw;
        
@@ -316,9 +320,7 @@ sub preprocess_inline (@) { #{{{
                                $template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage}));
                                $template->param(title => pagetitle(basename($page)));
                                $template->param(ctime => displaytime($pagectime{$page}, $params{timeformat}));
-                               $template->param(ctime_raw => scalar localtime($pagectime{$page}));
                                $template->param(mtime => displaytime($pagemtime{$page}, $params{timeformat}));
-                               $template->param(mtime_raw => scalar localtime($pagemtime{$page}));
                                $template->param(first => 1) if $page eq $list[0];
                                $template->param(last => 1) if $page eq $list[$#list];
        
@@ -366,10 +368,6 @@ sub preprocess_inline (@) { #{{{
        }
        
        if ($feeds) {
-               if (exists $params{feedpages}) {
-                       @feedlist=grep { pagespec_match($_, $params{feedpages}, location => $params{page}) } @feedlist;
-               }
-       
                if ($rss) {
                        my $rssp=rsspage($params{destpage}).$feednum;
                        will_render($params{destpage}, $rssp);
@@ -378,7 +376,7 @@ sub preprocess_inline (@) { #{{{
                                        genfeed("rss",
                                                $config{url}."/".$rssp, $desc, $params{guid}, $params{destpage}, @feedlist));
                                $toping{$params{destpage}}=1 unless $config{rebuild};
-                               $feedlinks{$params{destpage}}=qq{<link rel="alternate" type="application/rss+xml" title="$desc (RSS)" href="$rssurl" />};
+                               $feedlinks{$params{destpage}}.=qq{<link rel="alternate" type="application/rss+xml" title="$desc (RSS)" href="$rssurl" />};
                        }
                }
                if ($atom) {
@@ -388,7 +386,7 @@ sub preprocess_inline (@) { #{{{
                                writefile($atomp, $config{destdir},
                                        genfeed("atom", $config{url}."/".$atomp, $desc, $params{guid}, $params{destpage}, @feedlist));
                                $toping{$params{destpage}}=1 unless $config{rebuild};
-                               $feedlinks{$params{destpage}}=qq{<link rel="alternate" type="application/atom+xml" title="$desc (Atom)" href="$atomurl" />};
+                               $feedlinks{$params{destpage}}.=qq{<link rel="alternate" type="application/atom+xml" title="$desc (Atom)" href="$atomurl" />};
                        }
                }
        }