11c72e898f12b69f0b726ff85747169f6df4ccff
Peter Palfrader Make local links point to t...

Peter Palfrader authored 19 years ago

1) #!wml
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

2) 
Peter Palfrader Make cvssandbox relative

Peter Palfrader authored 18 years ago

3) #<define-tag cvssandbox whitespace=delete>http://tor.eff.org/cvs/</define-tag>
4) <define-tag cvssandbox whitespace=delete>cvs/</define-tag>
Peter Palfrader Make local links point to t...

Peter Palfrader authored 19 years ago

5) 
6) #  Xinclude "locallinks.wmi"
7) #  Xinclude "langlocallinks.$(LANG).wmi"
8) 
Peter Palfrader Remove ././././././ from links

Peter Palfrader authored 18 years ago

9) <:
10) 	sub stripDotSlashs($) {
11) 		my ($s) = @_;
12) 		1 while ($s =~ s|/\./|/|);
13) 		1 while ($s =~ s|^\./||);
14) 		return $s;
15) 	};
16) :>
17) 
Peter Palfrader also use "use warnings"

Peter Palfrader authored 19 years ago

18) <define-tag page whitespace=delete><:{
Peter Palfrader Make translation status mor...

Peter Palfrader authored 19 years ago

19) 	my $page="%0";
20) 	my $lang="$(LANG)";
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

21) 	my ($dir, $base) = $page =~ m,^(?:(.*)/)?(.*?)$,;
22) 	$dir = '.' unless defined $dir;
23) 	if (-e "$(DOCROOT)/$dir/$lang/$base.wml") {
Peter Palfrader Remove ././././././ from links

Peter Palfrader authored 18 years ago

24) 		print stripDotSlashs("$(DOCROOT)/$dir/$base.html.$lang");
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

25) 	} elsif (-e "$(DOCROOT)/$dir/en/$base.wml") {
Peter Palfrader Remove ././././././ from links

Peter Palfrader authored 18 years ago

26) 		print stripDotSlashs("$(DOCROOT)/$dir/$base.html");
Peter Palfrader Make local links point to t...

Peter Palfrader authored 19 years ago

27) 	} else {
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

28) 		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.";
Peter Palfrader Make local links point to t...

Peter Palfrader authored 19 years ago

29) 	};