]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/inline.pm
comments: add regression test for sorting by date
[git.ikiwiki.info.git] / IkiWiki / Plugin / inline.pm
index d89e14197f4edfd1e1db5a137e1b6c8584e97eb0..ffdf397f1f337af6cfcb6435f8aaf35fcc63faf7 100644 (file)
@@ -294,11 +294,11 @@ sub preprocess_inline (@) {
        if ($feeds) {
                if ($rss) {
                        $rssurl=abs2rel($feedbase."rss".$feednum, dirname(htmlpage($params{destpage})));
-                       $rssdesc = gettext("%s (RSS feed)", $desc);
+                       $rssdesc = sprintf(gettext("%s (RSS feed)"), $desc);
                }
                if ($atom) {
                        $atomurl=abs2rel($feedbase."atom".$feednum, dirname(htmlpage($params{destpage})));
-                       $atomdesc = gettext("%s (Atom feed)", $desc);
+                       $atomdesc = sprintf(gettext("%s (Atom feed)"), $desc);
                }
        }
 
@@ -329,6 +329,10 @@ sub preprocess_inline (@) {
                        $formtemplate->param(postformtext =>
                                gettext("Add a new post titled:"));
                }
+               if (exists $params{id}) {
+                       $formtemplate->param(postformid =>
+                               $params{id});
+               }
                $ret.=$formtemplate->output;
                
                # The post form includes the feed buttons, so
@@ -346,6 +350,9 @@ sub preprocess_inline (@) {
                        $linktemplate->param(atomurl => $atomurl);
                        $linktemplate->param(atomdesc => $atomdesc);
                }
+               if (exists $params{id}) {
+                       $linktemplate->param(id => $params{id});
+               }
                $ret.=$linktemplate->output;
        }
        
@@ -440,7 +447,7 @@ sub preprocess_inline (@) {
                        if (! $params{preview}) {
                                writefile($rssp, $config{destdir},
                                        genfeed("rss",
-                                               $config{url}."/".$rssp, $desc, $params{guid}, $params{destpage}, @feedlist));
+                                               $config{url}."/".$rssp, $desc, $params{guid}, $params{page}, @feedlist));
                                $toping{$params{destpage}}=1 unless $config{rebuild};
                                $feedlinks{$params{destpage}}.=qq{<link rel="alternate" type="application/rss+xml" title="$rssdesc" href="$rssurl" />};
                        }
@@ -450,7 +457,7 @@ sub preprocess_inline (@) {
                        will_render($params{destpage}, $atomp);
                        if (! $params{preview}) {
                                writefile($atomp, $config{destdir},
-                                       genfeed("atom", $config{url}."/".$atomp, $desc, $params{guid}, $params{destpage}, @feedlist));
+                                       genfeed("atom", $config{url}."/".$atomp, $desc, $params{guid}, $params{page}, @feedlist));
                                $toping{$params{destpage}}=1 unless $config{rebuild};
                                $feedlinks{$params{destpage}}.=qq{<link rel="alternate" type="application/atom+xml" title="$atomdesc" href="$atomurl" />};
                        }