summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2010-04-21 00:16:32 +0200
committerJoey Hess <joey@kitenet.net>2010-04-21 12:49:31 -0400
commit0fa25a361cbb49711938599d6cf06201ce0cc79a (patch)
tree4edaeb0d5d6728ef49ee8d16099941590994c303
parent5d2df9651fee83cf17acde48ba12442104311492 (diff)
Always give createlink class to links to nonexistent pages
With this change, the <span> with class createlink is always created around the link text, even when no CGI URL is defined. This allows styling of these 'links' in this case too. The same class is used as when CGI URL is defined so that e.g. clones of the same ikiwiki, one with CGI and one without, display in the same way (modulo the missing question mark link). (cherry picked from commit 290d1b498f00f63e6d41218ddb76d87e68ed5081)
-rw-r--r--IkiWiki.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 6d3b6c606..ba2c09c36 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -1086,14 +1086,16 @@ sub htmllink ($$$;@) {
$bestlink=htmlpage($bestlink);
if (! $destsources{$bestlink}) {
- return $linktext unless length $config{cgiurl};
- return "<span class=\"createlink\"><a href=\"".
+ my $cgilink = "";
+ if (length $config{cgiurl}) {
+ $cgilink = "<a href=\"".
cgiurl(
do => "create",
page => lc($link),
from => $lpage
- ).
- "\" rel=\"nofollow\">?</a>$linktext</span>"
+ )."\" rel=\"nofollow\">?</a>";
+ }
+ return "<span class=\"createlink\">$cgilink$linktext</span>"
}
}