4c9015efdbcf5085935ca4c19b1216ef985efce4
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 clean up wiki and faq refer...

Andrew Lewman authored 13 years ago

9) <define-tag wiki whitespace=delete>https://trac.torproject.org/projects/tor/wiki/</define-tag>
10) <define-tag wikifaq whitespace=delete>https://trac.torproject.org/projects/tor/wiki/TheOnionRouter/TorFAQ</define-tag>
Andrew Lewman put the extra /blog back to...

Andrew Lewman authored 13 years ago

11) <define-tag blog whitespace=delete>https://blog.torproject.org/blog/</define-tag>
Andrew Lewman replicate the tbb repo link...

Andrew Lewman authored 13 years ago

12) <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

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

Andrew Lewman authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Andrew Lewman authored 13 years ago

37) 	    	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

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

Andrew Lewman authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Andrew Lewman authored 13 years ago

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