2010-07-09 01:55:22 +00:00
#!wml
2010-08-06 12:42:45 +00:00
<define-tag gitblob whitespace=delete>https://gitweb.torproject.org/tor.git?a=blob_plain;hb=HEAD;f=</define-tag>
2013-12-12 05:08:13 +00:00
<define-tag gitblobstable whitespace=delete>https://gitweb.torproject.org/tor.git?a=blob_plain;hb=release-0.2.4;f=</define-tag>
2010-08-06 12:42:45 +00:00
<define-tag gittree whitespace=delete>https://gitweb.torproject.org/tor.git?a=tree;hb=HEAD;f=</define-tag>
<define-tag gitrepo whitespace=delete>https://gitweb.torproject.org/tor.git?a=tree;hb=HEAD</define-tag>
2010-07-09 01:55:22 +00:00
<define-tag svnwebsite whitespace=delete>https://svn.torproject.org/svn/website/trunk/</define-tag>
<define-tag svnprojects whitespace=delete>https://svn.torproject.org/svn/projects/</define-tag>
2010-10-08 14:54:16 +00:00
<define-tag wiki whitespace=delete>https://trac.torproject.org/projects/tor/wiki/</define-tag>
2011-06-11 18:55:49 +00:00
<define-tag wikifaq whitespace=delete>https://trac.torproject.org/projects/tor/wiki/doc/TorFAQ</define-tag>
2010-10-11 17:24:57 +00:00
<define-tag blog whitespace=delete>https://blog.torproject.org/blog/</define-tag>
2010-10-08 13:33:59 +00:00
<define-tag tbbrepo whitespace=delete>https://gitweb.torproject.org/torbrowser.git/blob_plain/HEAD:</define-tag>
2011-02-21 22:10:53 +00:00
<define-tag specblob whitespace=delete>https://gitweb.torproject.org/torspec.git?a=blob_plain;hb=HEAD;f=</define-tag>
<define-tag spectree whitespace=delete>https://gitweb.torproject.org/torspec.git?a=tree;hb=HEAD;f=</define-tag>
2011-10-27 16:12:08 +00:00
<define-tag doxygen whitespace=delete>https://doxygen.torproject.org/</define-tag>
2011-02-21 22:10:53 +00:00
2010-07-09 01:55:22 +00:00
# Xinclude "locallinks.wmi"
# Xinclude "langlocallinks.$(LANG).wmi"
<:
sub stripDotSlashs($) {
my ($s) = @_;
1 while ($s =~ s|/\./|/|);
1 while ($s =~ s|^\./||);
return $s;
};
:>
<: sub pageToURL($$) {
my ($page, $lang) = @_;
my ($dir, $base) = $page =~ m,^(?:(.*)/)?(.*?)$,;
$dir = '.' unless defined $dir;
2011-03-09 17:44:19 +00:00
if (-e "$(DOCROOT)/$dir/$lang/$base.wml") {
2010-07-09 01:55:22 +00:00
return stripDotSlashs("$(DOCROOT)/$dir/$base.html.$lang");
} elsif (-e "$(DOCROOT)/$dir/en/$base.wml") {
2010-08-17 22:57:49 +00:00
return stripDotSlashs("$(DOCROOT)/$dir/$base.html.en");
2011-03-09 17:44:19 +00:00
} elsif ($page =~ /^http/) {
return $page;
2010-07-09 01:55:22 +00:00
} else {
2011-03-09 17:44:19 +00:00
warn "$WML_SRC_FILENAME has a [page $page] (parses to docdir: $(DOCROOT)/; dir: $dir; base: $base -> $(DOCROOT)/$dir/$lang/$base.wml), but that doesn't exist.";
2010-07-09 01:55:22 +00:00
};
}
:>
<define-tag page whitespace=delete>
<:{
my $page="%0";
my $lang="$(LANG)";
my ($dir, $base) = $page =~ m,^(?:(.*)/)?(.*?)$,;
$dir = '.' unless defined $dir;
if (-e "$(DOCROOT)/$dir/$lang/$base.wml") {
print stripDotSlashs("$(DOCROOT)/$dir/$base.html.$lang");
2011-03-09 17:44:19 +00:00
} elsif (-e "$(DOCROOT)/$dir/en/$base.wml") {
2010-07-09 01:55:22 +00:00
print stripDotSlashs("$(DOCROOT)/$dir/$base.html");
} else {
2011-03-09 17:44:19 +00:00
warn "$WML_SRC_FILENAME has a [page $page] (parses to docdir: $(DOCROOT)/; dir: $dir; base: $base -> $(DOCROOT)/$dir/$lang/$base.wml), but that doesn't exist.";
2010-07-09 01:55:22 +00:00
};
}:>
</define-tag>