[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Move website to wml



Update of /home/or/cvsroot/website/include
In directory moria:/tmp/cvs-serv31992/include

Added Files:
	functions.wmi head.wmi links.wmi versions.wmi 
Log Message:
Move website to wml

--- NEW FILE: functions.wmi ---
#!/usr/bin/wml

<:

sub getMetadata($) {
	my ($file) = @_;

	open(F, "$file") or die ("Cannot open $file: $!\n");
	my $found_metadata = 0;
	while (<F>) {
		chomp;
		if ($_ eq '## translation metadata') {
			$found_metadata = 1;
			last;
		};
	};
	die ("Did not find translation metadata in $file") unless $found_metadata;
	my %data;
	while (<F>) {
		chomp;
		if (/^#\s*(\S*):\s*(.*?)\s*$/) {
			$data{$1} = $2;
		} else {
			last;
		};
	};
	return %data;
};

sub translation_get_masterrevision() {
	my $page = $WML_SRC_FILENAME;
	%master = getMetadata("en/$WML_SRC_FILENAME");

	die ("Cannot find 'Revision' header in master's translation metadata of en/$WML_SRC_FILENAME") unless exists $master{'Revision'};

	my ($rev) = $master{'Revision'} =~ m/([0-9.]+)/;
	if ($rev eq '') { $rev = '(Revision not a valid number)'; };

	return $rev;
};

sub translation_get_basedonrevision() {
	my $page = $WML_SRC_FILENAME;
	%translation = getMetadata("$(LANG)/$WML_SRC_FILENAME");

	die ("Cannot find 'Based-On-Revision' header in translations's translation metadata of $(LANG)/$WML_SRC_FILENAME") unless exists $translation{'Based-On-Revision'};

	my ($rev) = $translation{'Based-On-Revision'};
	if ($rev eq '') { $rev = '(unknown)'; };

	return $rev
};


sub translation_current() {
	return (translation_get_masterrevision() eq translation_get_basedonrevision());
};

:>

--- NEW FILE: head.wmi ---
#! /usr/bin/wml
#include "links.wmi"
#include "versions.wmi"
#include "navigation.wmi"

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en">
<head>
  <title>Tor: $(TITLE)</title>
  <meta name="Author" content="Roger Dingledine" />
  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
  <link rel="stylesheet" type="text/css" href="stylesheet.css" />
  <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
  <ifneq "$(REDIRECT)" "" "<meta http-equiv="refresh" content="0;url=$(REDIRECT).html" />">
</head>

<body>

<:
	%languages = (
		'en' => "English",
		'de' => "Deutsch",
		'it' => "Italiano"
		);
:>

<div class="center">
<table class="banner" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td class="banner-left"></td>
        <td class="banner-middle">
	<:
	    while (@navigation) {
	      $key = shift @navigation;
	      $val = shift @navigation;
	      push @keys, $key;
	      $navigation{$key} = $val;
	    }

	    for $key (@keys) {
	      $page = $WML_SRC_FILENAME;
	      $page =~ s/\.wml//;
	      if ($page ne $key) {
	        printf '<a href="%s.$(LANG).html">%s</a>'."\n", $key, $navigation{$key};
	       } else {
	        printf '<a class="current">%s</a>'."\n", $navigation{$key};
	       }
	     }
	:>
        </td>
        <td class="banner-right">
	<:
	  opendir(DIR, ".") || die ("Cannot open directory .: $!\n");
	  my @subdirs = grep { $_ ne '.' && $_ ne '..' && -d $_ && $_ ne "$(LANG)" && exists $languages{$_}} readdir(DIR);
	  closedir(DIR);

	  $page = $WML_SRC_FILENAME;
	  $page =~ s/\.wml//;
	  for my $dir (sort {$languages{$a} cmp $languages{$b}} @subdirs) {
	    printf('<a href="%s.%s.html"><img src="$(IMGROOT)/%s.png" alt="%s" /></a>', $page, $dir, $dir, $languages{$dir}) if (-e "$dir/$WML_SRC_FILENAME");
	  };
	:>
        </td>
    </tr>
</table>

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

--- NEW FILE: links.wmi ---

<define-tag cvssandbox whitespace=delete>http://tor.eff.org/cvs/</define-tag>

--- NEW FILE: versions.wmi ---

<define-tag version-stable            whitespace=delete>0.1.0.15</define-tag>
<define-tag version-alpha             whitespace=delete>0.1.1.7-alpha</define-tag>



<define-tag version-win32-stable      whitespace=delete>0.1.0.15</define-tag>
<define-tag version-win32-alpha       whitespace=delete>0.1.1.7-alpha</define-tag>

<define-tag version-osx-stable        whitespace=delete>0.1.0.15</define-tag>
<define-tag version-osx-alpha         whitespace=delete>0.1.1.7-alpha</define-tag>

<define-tag version-oldosx-stable     whitespace=delete>0.1.0.15</define-tag>

<define-tag version-rpm-stable        whitespace=delete>0.1.0.15</define-tag>
<define-tag version-rpm-alpha         whitespace=delete>0.1.1.7-alpha</define-tag>

<define-tag package-rpm-stable        whitespace=delete>dist/rpm/tor-0.1.0.15-tor.0.fc4.i386.rpm</define-tag>
<define-tag package-srpm-stable       whitespace=delete>dist/rpm/tor-0.1.0.15-tor.0.fc4.src.rpm</define-tag>

<define-tag package-rpm-alpha         whitespace=delete>dist/rpm/tor-0.1.1.7.alpha-tor.0.fc1.i386.rpm</define-tag>
<define-tag package-srpm-alpha        whitespace=delete>dist/rpm/tor-0.1.1.7.alpha-tor.0.fc1.src.rpm</define-tag>






<define-tag package-win32-stable      whitespace=delete>dist/win32/tor-<version-win32-stable>-win32.exe</define-tag>
<define-tag package-win32-alpha       whitespace=delete>dist/win32/tor-<version-win32-alpha>-win32.exe</define-tag>

<define-tag package-osx-stable        whitespace=delete>dist/osx/Tor <version-osx-stable> Bundle.dmg</define-tag>
<define-tag package-osx-alpha         whitespace=delete>dist/osx/Tor <version-osx-alpha> Bundle.dmg</define-tag>

<define-tag package-oldosx-stable     whitespace=delete>dist/osx-old/Tor <version-oldosx-stable>-gcc3 Bundle.dmg</define-tag>

<define-tag package-source-stable     whitespace=delete>dist/tor-<version-stable>.tar.gz</define-tag>
<define-tag package-source-alpha      whitespace=delete>dist/tor-<version-alpha>.tar.gz</define-tag>



<define-tag package-win32-stable-sig  whitespace=delete><package-win32-stable>.asc</define-tag>
<define-tag package-win32-alpha-sig   whitespace=delete><package-win32-alpha>.asc</define-tag>

<define-tag package-osx-stable-sig    whitespace=delete><package-osx-stable>.asc</define-tag>
<define-tag package-osx-alpha-sig     whitespace=delete><package-osx-alpha>.asc</define-tag>

<define-tag package-oldosx-stable-sig whitespace=delete><package-oldosx-stable>.asc</define-tag>

<define-tag package-rpm-stable-sig    whitespace=delete><package-rpm-stable>.asc</define-tag>
<define-tag package-rpm-alpha-sig     whitespace=delete><package-rpm-alpha>.asc</define-tag>

<define-tag package-srpm-stable-sig   whitespace=delete><package-srpm-stable>.asc</define-tag>
<define-tag package-srpm-alpha-sig    whitespace=delete><package-srpm-alpha>.asc</define-tag>

<define-tag package-source-stable-sig whitespace=delete><package-source-stable>.asc</define-tag>
<define-tag package-source-alpha-sig  whitespace=delete><package-source-alpha>.asc</define-tag>