return $url;
} #}}}
-sub urlto ($$) { #{{{
+sub urlto ($$;$) { #{{{
my $to=shift;
my $from=shift;
-
+ my $absolute=shift;
+
if (! length $to) {
return beautify_urlpath(baseurl($from)."index.$config{htmlext}");
}
$to=htmlpage($to);
}
+ if ($absolute) {
+ return $config{url}.beautify_urlpath("/".$to);
+ }
+
my $link = abs2rel($to, dirname(htmlpage($from)));
return beautify_urlpath($link);
my $page=shift;
my @pages=@_;
- my $url=URI->new(encode_utf8($config{url}."/".urlto($page,"")));
+ my $url=URI->new(encode_utf8(urlto($page,"",1)));
my $itemtemplate=template($feedtype."item.tmpl", blind_cache => 1);
my $content="";
my $lasttime = 0;
foreach my $p (@pages) {
- my $u=URI->new(encode_utf8($config{url}."/".urlto($p, "")));
+ my $u=URI->new(encode_utf8(urlto($p, "", 1)));
my $pcontent = absolute_urls(get_inline_content($p, $page), $url);
$itemtemplate->param(
foreach my $page (keys %toping) {
my $title=pagetitle(basename($page), 0);
- my $url="$config{url}/".urlto($page, "");
+ my $url=urlto($page, "", 1);
foreach my $pingurl (@{$config{pingurl}}) {
debug("Pinging $pingurl for $page");
eval {
This is the standard gettext function, although slightly optimised.
-#### `urlto($$)`
+#### `urlto($$;$)`
Construct a relative url to the first parameter from the page named by the
second. The first parameter can be either a page name, or some other
destination file, as registered by `will_render`.
+If the third parameter is passed and is true, an absolute url will be
+constructed instead of the default relative url.
+
#### `targetpage($$)`
Passed a page and an extension, returns the filename that page will be
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-07-25 15:21-0400\n"
+"POT-Creation-Date: 2008-07-25 16:16-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "You are banned."
msgstr ""
-#: ../IkiWiki/CGI.pm:758 ../IkiWiki/CGI.pm:759 ../IkiWiki.pm:783
+#: ../IkiWiki/CGI.pm:758 ../IkiWiki/CGI.pm:759 ../IkiWiki.pm:788
msgid "Error"
msgstr ""
#. translators: preprocessor directive name,
#. translators: the second a page name, the
#. translators: third a number.
-#: ../IkiWiki.pm:766
+#: ../IkiWiki.pm:771
#, perl-format
msgid "%s preprocessing loop detected on %s at depth %i"
msgstr ""
-#: ../IkiWiki.pm:1214
+#: ../IkiWiki.pm:1219
msgid "yes"
msgstr ""