X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/e35cefac5d9d25ddedbf2ab01773034a46d72220..d9f1b1214926832793103adef926c0bccc833b48:/ikiwiki diff --git a/ikiwiki b/ikiwiki index f8b43d720..9e9c29354 100755 --- a/ikiwiki +++ b/ikiwiki @@ -19,9 +19,9 @@ sub getconfig () { #{{{ if (! exists $ENV{WRAPPED_OPTIONS}) { %config=( wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.html?$)}, - wiki_link_regexp => qr/\[\[([^\s\]]+)\]\]/, + wiki_link_regexp => qr/\[\[(?:([^\s\]\|]+)\|)?([^\s\]]+)\]\]/, wiki_processor_regexp => qr/\[\[(\w+)\s+([^\]]+)\]\]/, - wiki_file_regexp => qr/(^[-A-Za-z0-9_.\&;:\/+]+$)/, + wiki_file_regexp => qr/(^[-A-Za-z0-9_.:\/+]+$)/, verbose => 0, wikiname => "wiki", default_pageext => ".mdwn", @@ -32,8 +32,10 @@ sub getconfig () { #{{{ historyurl => '', diffurl => '', anonok => 0, - rss => 1, + rss => 0, rebuild => 0, + refresh => 0, + getctime => 0, wrapper => undef, wrappermode => undef, srcdir => undef, @@ -49,6 +51,8 @@ sub getconfig () { #{{{ "wikiname=s" => \$config{wikiname}, "verbose|v!" => \$config{verbose}, "rebuild!" => \$config{rebuild}, + "refresh!" => \$config{refresh}, + "getctime" => \$config{getctime}, "wrappermode=i" => \$config{wrappermode}, "svn!" => \$config{svn}, "anonok!" => \$config{anonok}, @@ -238,7 +242,7 @@ sub bestlink ($$) { #{{{ sub isinlinableimage ($) { #{{{ my $file=shift; - $file=~/\.(png|gif|jpg|jpeg)$/; + $file=~/\.(png|gif|jpg|jpeg)$/i; } #}}} sub pagetitle ($) { #{{{ @@ -248,11 +252,12 @@ sub pagetitle ($) { #{{{ return $page; } #}}} -sub htmllink ($$;$$) { #{{{ +sub htmllink ($$;$$$) { #{{{ my $page=shift; my $link=shift; my $noimageinline=shift; # don't turn links into inline html images my $forcesubpage=shift; # force a link to a subpage + my $linktext=shift; # set to force the link text to something my $bestlink; if (! $forcesubpage) { @@ -262,7 +267,7 @@ sub htmllink ($$;$$) { #{{{ $bestlink="$page/".lc($link); } - my $linktext=pagetitle($link); + $linktext=pagetitle(basename($link)) unless defined $linktext; return $linktext if length $bestlink && $page eq $bestlink; @@ -486,6 +491,7 @@ sub main () { #{{{ loadindex(); require IkiWiki::Render; rcs_update(); + rcs_getctime() if $config{getctime}; refresh(); saveindex(); }