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

Andrew Lewman authored 13 years ago

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

Andrew Lewman authored 13 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 13 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 13 years ago

9) <define-tag wiki whitespace=delete>https://trac.torproject.org/projects/tor/wiki/TheOnionRouter/</define-tag>
Andrew Lewman replicate the tbb repo link...

Andrew Lewman authored 13 years ago

10) <define-tag blog whitespace=delete>https://blog.torproject.org/</define-tag>
11) <define-tag tbbrepo whitespace=delete>https://gitweb.torproject.org/torbrowser.git/blob_plain/HEAD:</define-tag>
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Andrew Lewman authored 13 years ago

36) 	    	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 13 years ago

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

Andrew Lewman authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Andrew Lewman authored 13 years ago

52) 		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.";