summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2008-11-11 15:27:39 +0100
committerintrigeri <intrigeri@boum.org>2008-11-11 15:27:39 +0100
commit43a1d36378c085ed9c71e066686907104c91da7e (patch)
tree4f9fd114337ed696c81ed541dec30d31921466c5
parent18331e9261c40eb577f7553c3a42232d5a593e82 (diff)
po: added HOMEPAGEURL template variable, documented when to use it
Hopefully all links should now be consistent with the chosen linking behavior, but who knows... Signed-off-by: intrigeri <intrigeri@boum.org>
-rw-r--r--IkiWiki/Plugin/po.pm8
-rw-r--r--doc/plugins/po.mdwn4
2 files changed, 12 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 42a125808..739564c6b 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -285,6 +285,9 @@ sub pagetemplate (@) { #{{{
if ($template->query(name => "istranslatable")) {
$template->param(istranslatable => istranslatable($page));
}
+ if ($template->query(name => "HOMEPAGEURL")) {
+ $template->param(homepageurl => homepageurl($page));
+ }
if ($template->query(name => "otherlanguages")) {
$template->param(otherlanguages => [otherlanguagesloop($page)]);
map add_depends($page, $_), (values %{otherlanguages($page)});
@@ -705,6 +708,11 @@ sub otherlanguagesloop ($) { #{{{
} @ret;
} #}}}
+sub homepageurl (;$) { #{{{
+ my $page=shift;
+
+ return urlto('', $page);
+} #}}}
# ,----
# | PageSpec's
diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn
index 2f359bb83..d27b5af1d 100644
--- a/doc/plugins/po.mdwn
+++ b/doc/plugins/po.mdwn
@@ -129,6 +129,10 @@ Usage
Templates
---------
+When `po_link_to` is not set to `negotiated`, one should replace some
+occurrences of `BASEURL` with `HOMEPAGEURL` to get correct links to
+the wiki homepage.
+
The `ISTRANSLATION` and `ISTRANSLATABLE` variables can be used to
display things only on translatable or translation pages.