]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/inline.pm
po plugin: move translatable pages to setup file, refactor
[git.ikiwiki.info.git] / IkiWiki / Plugin / inline.pm
index e0f33ef315e8a1539c3e5c4da1bb4fa03d419d65..536d7cd027b87543d29fe7ebe2e132aed990f695 100644 (file)
@@ -114,7 +114,7 @@ sub format (@) { #{{{
        return $params{content};
 } #}}}
 
-sub sessioncgi () { #{{{
+sub sessioncgi ($$) { #{{{
        my $q=shift;
        my $session=shift;
 
@@ -266,6 +266,9 @@ sub preprocess_inline (@) { #{{{
                my $rootpage;
                if (exists $params{rootpage}) {
                        $rootpage=bestlink($params{page}, $params{rootpage});
+                       if (!length $rootpage) {
+                               $rootpage=$params{rootpage};
+                       }
                }
                else {
                        $rootpage=$params{page};
@@ -313,6 +316,9 @@ 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];
        
@@ -372,7 +378,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="RSS" href="$rssurl" />};
+                               $feedlinks{$params{destpage}}=qq{<link rel="alternate" type="application/rss+xml" title="$desc (RSS)" href="$rssurl" />};
                        }
                }
                if ($atom) {
@@ -382,7 +388,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="Atom" href="$atomurl" />};
+                               $feedlinks{$params{destpage}}=qq{<link rel="alternate" type="application/atom+xml" title="$desc (Atom)" href="$atomurl" />};
                        }
                }
        }