]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Render.pm
support [[linktext|pagename]] links
[ikiwiki.git] / IkiWiki / Render.pm
index 4e2caa6cef31435bc026bf70f9b7573d406e46c1..504edc843cc8d7e6693822659ac2477c39798d13 100644 (file)
@@ -9,7 +9,8 @@ sub linkify ($$) { #{{{
        my $page=shift;
 
        $content =~ s{(\\?)$config{wiki_link_regexp}}{
-               $1 ? "[[$2]]" : htmllink($page, $2)
+               $2 ? ( $1 ? "[[$2|$3]]" : htmllink($page, $3, 0, 0, pagetitle($2)))
+                  : ( $1 ? "[[$3]]" :    htmllink($page, $3))
        }eg;
        
        return $content;
@@ -215,7 +216,7 @@ sub genpage ($$$) { #{{{
        }
 
        if ($config{rss} && $inlinepages{$page}) {
-               $template->param(rssurl => rsspage($page));
+               $template->param(rssurl => rsspage(basename($page)));
        }
        
        $template->param(
@@ -266,8 +267,6 @@ sub genrss ($$$) { #{{{
                my $parentpage=shift;
                my %params=@_;
                
-               return "" if exists $params{archive} && $params{archive} eq 'yes';
-               
                if (! exists $params{show}) {
                        $params{show}=10;
                }
@@ -315,9 +314,9 @@ sub check_overwrite ($$) { #{{{
 } #}}}
 
 sub mtime ($) { #{{{
-       my $page=shift;
+       my $file=shift;
        
-       return (stat($page))[9];
+       return (stat($file))[9];
 } #}}}
 
 sub findlinks ($$) { #{{{
@@ -326,7 +325,7 @@ sub findlinks ($$) { #{{{
 
        my @links;
        while ($content =~ /(?<!\\)$config{wiki_link_regexp}/g) {
-               push @links, lc($1);
+               push @links, lc($2);
        }
        # Discussion links are a special case since they're not in the text
        # of the page, but on its template.
@@ -418,7 +417,8 @@ sub refresh () { #{{{
                        push @add, $file;
                        $links{$page}=[];
                        $pagesources{$page}=$file;
-                       $pagectime{$page}=time unless exists $pagectime{$page};
+                       $pagectime{$page}=mtime("$config{srcdir}/$file") 
+                               unless exists $pagectime{$page};
                }
        }
        my @del;