998b0ca43f512010ae7f19cf2f5ee22e9d48d4be
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

1) #! /usr/bin/wml
Peter Palfrader Make translation status mor...

Peter Palfrader authored 18 years ago

2) <: use strict; :>
Peter Palfrader also use "use warnings"

Peter Palfrader authored 18 years ago

3) <: use warnings; :>
4) #use "perl-globals.wmi"
5) #use "links.wmi"
6) #use "versions.wmi"
7) #use "navigation.wmi"
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

8) 
Peter Palfrader We don't claim to do XML an...

Peter Palfrader authored 18 years ago

9) #<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Sebastian Hahn Change our doctype to refer...

Sebastian Hahn authored 15 years ago

10) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
Peter Palfrader We don't claim to do XML an...

Peter Palfrader authored 18 years ago

11) #<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
12) <html>
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

13) <head>
Roger Dingledine stop prefacing everything w...

Roger Dingledine authored 16 years ago

14)   <title>$(TITLE)</title>
Andrew Lewman change the author to tor, s...

Andrew Lewman authored 14 years ago

15)   <meta name="Author" content="The Tor Project, Inc." />
Roger Dingledine mandate UTF-8 on all wml pages

Roger Dingledine authored 14 years ago

16)   <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
Jacob Appelbaum A new header that selects e...

Jacob Appelbaum authored 15 years ago

17)   <ifneq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/$(STYLESHEET)" />">
18)   <ifeq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/stylesheet-ltr.css" />">
Roger Dingledine make the favicon.ico link r...

Roger Dingledine authored 18 years ago

19)   <link rel="shortcut icon" type="image/x-icon" href="$(DOCROOT)/favicon.ico" />
Roger Dingledine Hack weasel's wml voodoo to...

Roger Dingledine authored 17 years ago

20)   <ifneq "$(REDIRECT)" "" "<meta http-equiv="refresh" content="0;url=$(DOCROOT)/$(REDIRECT)" />">
Sebastian Hahn Add a REDIRECT_GLOBAL varia...

Sebastian Hahn authored 14 years ago

21)   <ifneq "$(REDIRECT_GLOBAL)" "" "<meta http-equiv="refresh" content="0;url=$(REDIRECT_GLOBAL)" />">
Sebastian Hahn Attempt to create valid htm...

Sebastian Hahn authored 15 years ago

22)   <ifeq "$(ANNOUNCE_RSS)" "yes" "<link rel="alternate" title="Tor Project OR-announce" href="http://rss.gmane.org/gmane.network.onion-routing.announce" type="application/rss+xml" />">
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

23) </head>
24) 
25) <body>
26) 
27) <div class="center">
28) <table class="banner" border="0" cellpadding="0" cellspacing="0">
29)     <tr>
Andrew Lewman Updated the url to www.tp.o...

Andrew Lewman authored 16 years ago

30)         <td class="banner-left"><a href="https://www.torproject.org/"><img src="$(DOCROOT)/images/top-left.png" alt="Click to go to home page" width="193" height="79"></a></td>
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

31)         <td class="banner-middle">
Peter Palfrader also use "use warnings"

Peter Palfrader authored 18 years ago

32) 	<:{
Peter Palfrader Make translation status mor...

Peter Palfrader authored 18 years ago

33) 	    my %navigation;
34) 	    my @keys;
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

35) 	    while (@navigation) {
Peter Palfrader Make translation status mor...

Peter Palfrader authored 18 years ago

36) 	      my $key = shift @navigation;
37) 	      my $val = shift @navigation;
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

38) 	      push @keys, $key;
39) 	      $navigation{$key} = $val;
40) 	    }
41) 
Peter Palfrader Make translation status mor...

Peter Palfrader authored 18 years ago

42) 	    for my $key (@keys) {
43) 	      my $page = $WML_SRC_FILENAME;
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

44) 	      $page =~ s/\.wml//;
45) 	      if ($page ne $key) {
Peter Palfrader Add gui and minor fixes

Peter Palfrader authored 18 years ago

46) 	        if (-e "$(DOCROOT)/$(LANG)/$key.wml") {
Peter Palfrader Remove ././././././ from links

Peter Palfrader authored 17 years ago

47) 	          printf '<a href="%s">%s</a>'."\n",
48) 	                 stripDotSlashs("$(DOCROOT)/$key.html.$(LANG)"), $navigation{$key};
Roger Dingledine link to the blog from the n...

Roger Dingledine authored 16 years ago

49) 	        } elsif ($key =~ /^http/) {
50) 	          printf '<a href="%s">%s</a>'."\n", $key, $navigation{$key};
Roger Dingledine bugfix on the website: the...

Roger Dingledine authored 18 years ago

51) 	        } else {
Peter Palfrader Remove ././././././ from links

Peter Palfrader authored 17 years ago

52) 	          printf '<a href="%s">%s</a>'."\n",
53) 	                 stripDotSlashs("$(DOCROOT)/$key.html"), $navigation{$key};
Roger Dingledine bugfix on the website: the...

Roger Dingledine authored 18 years ago

54) 	        }
55) 	      } else {
56) 	       printf '<a class="current">%s</a>'."\n", $navigation{$key};
57) 	      }
58) 	    }
Peter Palfrader also use "use warnings"

Peter Palfrader authored 18 years ago

59) 	}:>
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

60)         </td>
61)     </tr>
62) </table>
63) 
Roger Dingledine Hack weasel's wml voodoo to...

Roger Dingledine authored 17 years ago

64) <ifneq "$(REDIRECT)" "" "Redirecting to <a href="$(DOCROOT)/$(REDIRECT)">$(DOCROOT)/$(REDIRECT)</a>.">