]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
* inline: Add timeformat parameter to control how the ctime of
[ikiwiki.git] / IkiWiki.pm
index 0b9790d8a15078f242e21db3ab80e14084eab09d..ad4d26741af22a5a0f087917ebc8334e819f7398 100644 (file)
@@ -39,7 +39,7 @@ sub defaultconfig () { #{{{
        wiki_link_regexp => qr{
                \[\[                    # beginning of link
                (?:
-                       ([^\]\|\n]+)    # 1: link text
+                       ([^\]\|\n\s]+)  # 1: link text
                        \|              # followed by '|'
                )?                      # optional
                
@@ -498,13 +498,16 @@ sub abs2rel ($$) { #{{{
        return $ret;
 } #}}}
 
-sub displaytime ($) { #{{{
+sub displaytime ($;$) { #{{{
        my $time=shift;
+       my $format=shift;
+       if (! defined $format) {
+               $format=$config{timeformat};
+       }
 
        # strftime doesn't know about encodings, so make sure
        # its output is properly treated as utf8
-       return decode_utf8(POSIX::strftime(
-                       $config{timeformat}, localtime($time)));
+       return decode_utf8(POSIX::strftime($format, localtime($time)));
 } #}}}
 
 sub beautify_url ($) { #{{{
@@ -563,7 +566,7 @@ sub htmllink ($$$;@) { #{{{
 
                if (! $destsources{$bestlink}) {
                        return $linktext unless length $config{cgiurl};
-                       return "<span><a href=\"".
+                       return "<span class=\"createlink\"><a href=\"".
                                cgiurl(
                                        do => "create",
                                        page => pagetitle(lc($link), 1),
@@ -826,6 +829,11 @@ sub enable_commit_hook () { #{{{
 } #}}}
 
 sub loadindex () { #{{{
+       %oldrenderedfiles=%pagectime=();
+       if (! $config{rebuild}) {
+               %pagesources=%pagemtime=%oldlinks=%links=%depends=
+                       %destsources=%renderedfiles=%pagecase=();
+       }
        open (my $in, "<", "$config{wikistatedir}/index") || return;
        while (<$in>) {
                $_=possibly_foolish_untaint($_);