X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/0a95ac2144de8552eeebabd6467bf25969352240..157357f1bbc6c9e988c28944e136e043a074eddd:/ikiwiki diff --git a/ikiwiki b/ikiwiki index 44a7abaf4..7a16be3ca 100755 --- a/ikiwiki +++ b/ikiwiki @@ -255,10 +255,26 @@ sub pagetitle ($) { #{{{ sub titlepage ($) { #{{{ my $title=shift; $title=~y/ /_/; - $title=~s/([^-A-Za-z0-9_:+\/])/"__".ord($1)."__"/eg; + $title=~s/([^-A-Za-z0-9_:+\/.])/"__".ord($1)."__"/eg; return $title; } #}}} +sub cgiurl (@) { #{{{ + my %params=@_; + + return $config{cgiurl}."?".join("&", map "$_=$params{$_}", keys %params); +} #}}} + +sub styleurl (;$) { #{{{ + my $page=shift; + + return "$config{url}/style.css" if ! defined $page; + + $page=~s/[^\/]+$//; + $page=~s/[^\/]+\//..\//g; + return $page."style.css"; +} #}}} + sub htmllink ($$;$$$) { #{{{ my $page=shift; my $link=shift; @@ -286,13 +302,15 @@ sub htmllink ($$;$$$) { #{{{ $bestlink=htmlpage($bestlink); } if (! grep { $_ eq $bestlink } values %renderedfiles) { - return "?$linktext" + return " "create", page => $link, from =>$page). + "\">?$linktext" } $bestlink=File::Spec->abs2rel($bestlink, dirname($page)); if (! $noimageinline && isinlinableimage($bestlink)) { - return ""; + return "\"$linktext\""; } return "$linktext"; } #}}} @@ -387,6 +405,7 @@ sub misctemplate ($$) { #{{{ indexlink => indexlink(), wikiname => $config{wikiname}, pagebody => $pagebody, + styleurl => styleurl(), ); return $template->output; }#}}}