mirror of
https://github.com/torproject/webwml.git
synced 2024-12-17 07:16:56 +00:00
Remove ././././././ from links
This commit is contained in:
parent
bc3ffdaa2b
commit
11c72e898f
6
Makefile
6
Makefile
@ -17,11 +17,11 @@ include $(WMLBASE)/Makefile.common
|
||||
all: $(SUBDIRS)
|
||||
|
||||
docs:
|
||||
$(MAKE) -C "$@" WMLBASE=../$(WMLBASE)
|
||||
$(MAKE) -C "$@" WMLBASE=..
|
||||
eff:
|
||||
$(MAKE) -C "$@" WMLBASE=../$(WMLBASE)
|
||||
$(MAKE) -C "$@" WMLBASE=..
|
||||
gui:
|
||||
$(MAKE) -C "$@" WMLBASE=../$(WMLBASE)
|
||||
$(MAKE) -C "$@" WMLBASE=..
|
||||
|
||||
# XXX: this also depends on all subs' wmlfiles. How to fix?
|
||||
translation-status.html.en: $(LANGS) $(WMIFILES) $(WMLFILES)
|
||||
|
@ -42,11 +42,11 @@
|
||||
$page =~ s/\.wml//;
|
||||
if ($page ne $key) {
|
||||
if (-e "$(DOCROOT)/$(LANG)/$key.wml") {
|
||||
printf '<a href="$(DOCROOT)/%s.html.$(LANG)">%s</a>'."\n",
|
||||
$key, $navigation{$key};
|
||||
printf '<a href="%s">%s</a>'."\n",
|
||||
stripDotSlashs("$(DOCROOT)/$key.html.$(LANG)"), $navigation{$key};
|
||||
} else {
|
||||
printf '<a href="$(DOCROOT)/%s.html">%s</a>'."\n",
|
||||
$key, $navigation{$key};
|
||||
printf '<a href="%s">%s</a>'."\n",
|
||||
stripDotSlashs("$(DOCROOT)/$key.html"), $navigation{$key};
|
||||
}
|
||||
} else {
|
||||
printf '<a class="current">%s</a>'."\n", $navigation{$key};
|
||||
|
@ -6,15 +6,24 @@
|
||||
# Xinclude "locallinks.wmi"
|
||||
# Xinclude "langlocallinks.$(LANG).wmi"
|
||||
|
||||
<:
|
||||
sub stripDotSlashs($) {
|
||||
my ($s) = @_;
|
||||
1 while ($s =~ s|/\./|/|);
|
||||
1 while ($s =~ s|^\./||);
|
||||
return $s;
|
||||
};
|
||||
:>
|
||||
|
||||
<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 "$(DOCROOT)/$dir/$base.html.$lang";
|
||||
print stripDotSlashs("$(DOCROOT)/$dir/$base.html.$lang");
|
||||
} elsif (-e "$(DOCROOT)/$dir/en/$base.wml") {
|
||||
print "$(DOCROOT)/$dir/$base.html";
|
||||
print stripDotSlashs("$(DOCROOT)/$dir/$base.html");
|
||||
} else {
|
||||
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.";
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user