]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/recentchanges.pm
Merge branch 'pub/po' into pub/master
[git.ikiwiki.info.git] / IkiWiki / Plugin / recentchanges.pm
index 563ab7db1950e1d9ca4863d54784a86ca2bd47ea..a73ff37b98f9f8ced928df004c96013017b676f2 100644 (file)
@@ -104,12 +104,7 @@ sub cgi ($) { #{{{
                                "</p>");
                }
                else {
                                "</p>");
                }
                else {
-                       if (defined pagetype($link)) {
-                               IkiWiki::redirect($cgi, $config{url}.IkiWiki::beautify_urlpath("/".htmlpage($link)));
-                       }
-                       else {
-                               IkiWiki::redirect($cgi, $config{url}.IkiWiki::beautify_urlpath("/".$link));
-                       }
+                       IkiWiki::redirect($cgi, urlto($link, undef, 1));
                }
 
                exit;
                }
 
                exit;
@@ -119,7 +114,7 @@ sub cgi ($) { #{{{
 sub store ($$$) { #{{{
        my $change=shift;
 
 sub store ($$$) { #{{{
        my $change=shift;
 
-       my $page="$config{recentchangespage}/change_".IkiWiki::titlepage($change->{rev});
+       my $page="$config{recentchangespage}/change_".titlepage($change->{rev});
 
        # Optimisation to avoid re-writing pages. Assumes commits never
        # change (or that any changes are not important).
 
        # Optimisation to avoid re-writing pages. Assumes commits never
        # change (or that any changes are not important).
@@ -137,11 +132,11 @@ sub store ($$$) { #{{{
                                                page => $_->{page}
                                        ).
                                        "\">".
                                                page => $_->{page}
                                        ).
                                        "\">".
-                                       IkiWiki::pagetitle($_->{page}).
+                                       pagetitle($_->{page}).
                                        "</a>"
                        }
                        else {
                                        "</a>"
                        }
                        else {
-                               $_->{link} = IkiWiki::pagetitle($_->{page});
+                               $_->{link} = pagetitle($_->{page});
                        }
                        $_->{baseurl}="$config{url}/" if length $config{url};
 
                        }
                        $_->{baseurl}="$config{url}/" if length $config{url};
 
@@ -180,6 +175,10 @@ sub store ($$$) { #{{{
                commitdate => displaytime($change->{when}, "%X %x"),
                wikiname => $config{wikiname},
        );
                commitdate => displaytime($change->{when}, "%X %x"),
                wikiname => $config{wikiname},
        );
+       
+       $template->param(permalink => "$config{url}/$config{recentchangespage}/#change-".titlepage($change->{rev}))
+               if exists $config{url};
+       
        IkiWiki::run_hooks(pagetemplate => sub {
                shift->(page => $page, destpage => $page,
                        template => $template, rev => $change->{rev});
        IkiWiki::run_hooks(pagetemplate => sub {
                shift->(page => $page, destpage => $page,
                        template => $template, rev => $change->{rev});