dedabfb05d0fa52c508f59182dda2136feb9072a
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 years ago

1) #!wml
2) 
Andrew Lewman work on the new website a b...

Andrew Lewman authored 14 years ago

3) <define-tag gitblob whitespace=delete>https://gitweb.torproject.org/tor.git?a=blob_plain;hb=HEAD;f=</define-tag>
4) <define-tag gitblobstable whitespace=delete>https://gitweb.torproject.org/tor.git?a=blob_plain;hb=release-0.2.1;f=</define-tag>
5) <define-tag gittree whitespace=delete>https://gitweb.torproject.org/tor.git?a=tree;hb=HEAD;f=</define-tag>
6) <define-tag gitrepo whitespace=delete>https://gitweb.torproject.org/tor.git?a=tree;hb=HEAD</define-tag>
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 years ago

7) <define-tag svnwebsite whitespace=delete>https://svn.torproject.org/svn/website/trunk/</define-tag>
8) <define-tag svnprojects whitespace=delete>https://svn.torproject.org/svn/projects/</define-tag>
Andrew Lewman fix up a broken bracket, ad...

Andrew Lewman authored 14 years ago

9) <define-tag wiki whitespace=delete>https://trac.torproject.org/projects/tor/wiki/TheOnionRouter/</define-tag>
10) <define-tag blog whitespace=delete>https://blog.torproject.org/blog/</define-tag>
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 years ago

11) 
12) #  Xinclude "locallinks.wmi"
13) #  Xinclude "langlocallinks.$(LANG).wmi"
14) 
15) <:
16) 	sub stripDotSlashs($) {
17) 		my ($s) = @_;
18) 		1 while ($s =~ s|/\./|/|);
19) 		1 while ($s =~ s|^\./||);
20) 		return $s;
21) 	};
22) :>
23) 
24) <:  sub pageToURL($$) {
25)  	    my ($page, $lang) = @_;
26) 	    my ($dir, $base) = $page =~ m,^(?:(.*)/)?(.*?)$,;
27) 	    $dir = '.' unless defined $dir;
Andrew Lewman switch to Goldstein's idea...

Andrew Lewman authored 14 years ago

28) 	    if (-e "$(DOCROOT)/$lang/$dir/$base.wml") {
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 years ago

29) 	    	return stripDotSlashs("$(DOCROOT)/$dir/$base.html.$lang");
30) 	    } elsif (-e "$(DOCROOT)/$dir/en/$base.wml") {
Andrew Lewman link to english files becau...

Andrew Lewman authored 14 years ago

31) 	    	return stripDotSlashs("$(DOCROOT)/$dir/$base.html.en");
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 years ago

32)         } elsif ($page =~ /^http/) {
33)           return $page;
34) 	    } else {
Andrew Lewman switch to Goldstein's idea...

Andrew Lewman authored 14 years ago

35) 	    	warn "$WML_SRC_FILENAME has a [page $page] (parses to docdir: $(DOCROOT)/; dir: $dir; base: $base -> $(DOCROOT)/$lang/$dir/$base.wml), but that doesn't exist.";
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 years ago

36) 	    }; 
37)     }
38) :>
39) 
40) <define-tag page whitespace=delete>
41) <:{
42) 	my $page="%0";
43) 	my $lang="$(LANG)";
44) 	my ($dir, $base) = $page =~ m,^(?:(.*)/)?(.*?)$,;
45) 	$dir = '.' unless defined $dir;
46) 	if (-e "$(DOCROOT)/$dir/$lang/$base.wml") {
47) 		print stripDotSlashs("$(DOCROOT)/$dir/$base.html.$lang");
Andrew Lewman switch to Goldstein's idea...

Andrew Lewman authored 14 years ago

48) 	} elsif (-e "$(DOCROOT)/en/$dir/$base.wml") {
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 years ago

49) 		print stripDotSlashs("$(DOCROOT)/$dir/$base.html");
50) 	} else {
Andrew Lewman switch to Goldstein's idea...

Andrew Lewman authored 14 years ago

51) 		warn "$WML_SRC_FILENAME has a [page $page] (parses to docdir: $(DOCROOT)/; dir: $dir; base: $base -> $(DOCROOT)/$lang/$dir/$base.wml), but that doesn't exist.";