Remove CVS links and such
[openssl-web.git] / openssl.wml
1 ##
2 ##  openssl.wml -- WML Template for the www.openssl.org website
3 ##  Written by Ralf S. Engelschall <rse@engelschall.com>
4 ##
5 ##  Usage: #use wml::openssl area=<area_name> [page=<page_name>]
6 ##
7
8 #use wml::std::tags
9 #use wml::std::info
10 #use wml::des::navbar
11 #use wml::des::space
12
13 ##
14 ##  The Global Page Layout
15 ##
16
17 #   start of page header
18 [PAGE_HEAD:\
19 <html>
20 <head>
21
22 #   insert information about the webpage
23 <info style=comment domainname="openssl.org"
24       copyright="1998-2014 The OpenSSL Project, http://www.openssl.org/">
25 <info style=meta domainname="openssl.org"
26       copyright="1998-2014 The OpenSSL Project, http://www.openssl.org/">
27
28 #   insert overideable title container
29 <title*>OpenSSL: {#PAGE_TITLE#}</title*>
30 #   predefine it to show errors
31 ..PAGE_TITLE!>>Error: Undefined Title !!<<..
32 #   define override tag
33 <define-tag title endtag=required>
34 ..PAGE_TITLE>>%body<<..
35 </define-tag>
36
37 #   define a style-sheet for adjusting some HTML layouting things
38 #   to conform to some typographically stronger conventions.
39 <style type="text/css"><!--
40 BODY      { position: absolute; left: 0px; top: 0px; background: #666699; }
41 A         { text-decoration: none; font-weight: bold; }
42 A:link    { text-decoration: none; font-weight: bold; color: #666699; }
43 A:visited { text-decoration: none; font-weight: bold; color: #666699; }
44 A:hover   { text-decoration: none; font-weight: bold; color: #666699; text-decoration: underline; }
45 \#red { color: #cc3333; }
46 \#sf  { font-family: arial,helvetica; font-variant: normal; font-style: normal; }
47 \#sfl { font-weight: bold; font-family: arial,helvetica; font-size: 16pt; \
48         line-height: 16pt; font-variant: normal; font-style: normal; }
49 H1    { font-weight: bold; font-size: 18pt; line-height: 18pt; \
50         font-family: arial,helvetica; font-variant: normal; font-style: normal; }
51 H2    { font-weight: bold; font-size: 14pt; line-height: 14pt; \
52         font-family: arial,helvetica; font-variant: normal; font-style: normal; }
53 H3    { font-weight: bold; font-size: 12pt; line-height: 12pt; \
54         font-family: arial,helvetica; font-variant: normal; font-style: normal; }
55 --></style>
56
57 #   end of header and start of physical body
58 #   (use additionally use colors here for older browsers)
59 </head>
60 <body link="#6666cc" alink="#6666cc" vlink="#6666cc" bgcolor="#666699" text="#000000"
61       marginheight=0 leftmargin=0 rightmargin=0 topmargin=0>
62
63 #   now define the page layout by a nested table
64 #   structure consisting of a 5x5 cell grid.
65 <table width=100% cellspacing=0 cellpadding=0 border=0>
66   #   visually: the top line of the page
67   <tr>\
68     <td align=left width=100 bgcolor="#666699"><img src="$(IMG)/page-head-tl.jpg" alt="OpenSSL"></td>\
69     <td align=left colspan=2 width=600 bgcolor="#666699"><img src="$(IMG)/page-head-tm.jpg" alt=""></td>\
70     <td align=right width=20 bgcolor="#666699">&nbsp;&nbsp;&nbsp;</td>\
71     <td align=right width=50 bgcolor="#666699">&nbsp;</td>\
72   </tr>
73   #   visually: the top of the white body with the subnavbar
74   <tr>\
75     <td align=left width=100><img src="$(IMG)/page-head-bl.jpg"></td>\
76     <td align=left width=20><img src="$(IMG)/page-head-bm.jpg"></td>\
77     <td align=left width=100% bgcolor="#ffffff">\
78         {#PAGE_SUBNAVBAR#}\
79     </td>\
80     <td align=right width=20><img src="$(IMG)/page-corner-tr.gif"></td>\
81     <td align=right width=50 bgcolor="#666699">&nbsp;</td>\
82   </tr>
83   #   visually: the left main navigation bar and the white body
84   <tr>\
85     <td align=left valign=top width=100 bgcolor="#666699">{#PAGE_NAVBAR#}</td>\
86     <td align=left valign=top width=20  bgcolor="#ffffff">&nbsp;</td>\
87     <td align=left valign=top bgcolor="#ffffff">\
88         <br>
89         :PAGE_HEAD][PAGE_BODY:
90         {#PAGE_BODY#}
91         :PAGE_BODY][PAGE_FOOT:\
92     </td>\
93     <td align=right width=20 bgcolor="#ffffff">&nbsp;&nbsp;&nbsp;</td>\
94     <td align=right width=50 bgcolor="#666699">&nbsp;</td>\
95   </tr>
96   #   visually: the bottom of the white body
97   <tr>\
98     <td align=left valign=top width=100 bgcolor="#666699">&nbsp;</td>\
99     <td align=left width=20><img src="$(IMG)/page-corner-bl.gif"></td>\
100     <td align=left valign=top bgcolor="#ffffff">&nbsp;</td>\
101     <td align=right width=20><img src="$(IMG)/page-corner-br.gif"></td>\
102     <td align=right width=50 bgcolor="#666699">&nbsp;</td>\
103   </tr>
104   #   visually: the bottom of the page (only for esthetical
105   #   reasons, i.e. the page doesn't end with the white body)
106   <tr>\
107     <td colspan=5 bgcolor="#666699">&nbsp;</td>\
108   </tr>
109 </table>
110
111 #   the physical end of the body
112 </body>
113 </html>
114 :PAGE_FOOT]
115
116 ##
117 ##  The main Navigation Bar [left, vertically]
118 ##
119
120 #   define the navigation bar through a grammar
121 <navbar:define name=navbar imgstar="n:s:s"
122                imgbase="$(IMG)" urlbase="$(ROOT)">
123   #   bar header
124   <navbar:header>
125   </navbar:header>
126   #   button prolog
127   <navbar:prolog>
128     <tr><td>
129   </navbar:prolog>
130   #   the buttons itself
131   <navbar:button id=title    url="."      txt="Title"        img=page-navbar-ti-*.jpg>
132   <navbar:button id=FAQ      url=support/faq.html   txt="FAQ"          img=page-navbar-fq-*.jpg>
133   <navbar:button id=about    url=about/   txt="About"        img=page-navbar-ab-*.jpg>
134   <navbar:button id=news     url=news/    txt="News"         img=page-navbar-ne-*.jpg>
135   <navbar:button id=docs     url=docs/    txt="Documents"    img=page-navbar-do-*.jpg>
136   <navbar:button id=source   url=source/  txt="Source"       img=page-navbar-so-*.jpg>
137   <navbar:button id=support  url=support/ txt="Support"      img=page-navbar-su-*.jpg>
138   <navbar:button id=related  url=related/ txt="Related"      img=page-navbar-re-*.jpg>
139   <navbar:button id=security url=news/vulnerabilities.html txt="Security"      img=page-navbar-se-*.jpg>
140   #   button epilog
141   <navbar:epilog>
142     </td></tr>
143   </navbar:epilog>
144   #   bar footer
145   <navbar:footer>
146   </navbar:footer>
147 </navbar:define>
148
149 #   and then immediately render it into its layout location
150 #   (Hint: The top and buttom images have to be part of the table
151 #   structure because only this way we can put them 0pt to the
152 #   buttons without a gap)
153 ..PAGE_NAVBAR>>\
154   <table cellspacing=0 cellpadding=0 border=0>\
155     <tr><td><img src="$(IMG)/page-navbar-top.jpg"></td></tr>
156     #   render it!
157     <navbar:render name=navbar select=$(area) $(page:+subselected)>
158     <tr><td><img src="$(IMG)/page-navbar-bot.jpg"><br><p></td></tr>
159   </table>
160 <<..
161
162 ##
163 ##  The Sub Navigation Bar (SNB) [top, horizontally]
164 ##
165
166 #   define the <snb>...</snb> container tag
167 <define-tag snb endtag=required>
168   #   1. define the navigation bar through a grammar
169   <navbar:define name=snb urlbase="$(SNB_ROOT)" 
170                  txtcol_normal="#666666" txtcol_select="#000000">
171     #   bar header
172     <navbar:header>\
173       <table cellspacing=0 cellpadding=0 border=0>
174         <tr>
175     </navbar:header>
176     #   button prolog (normal)
177     <navbar:prolog>\
178           <td><font face="Arial,Helvetica">&nbsp;
179     </navbar:prolog>
180     #   button prolog (selected)
181     <navbar:prolog type=S>\
182           <td bgcolor="#f0f0f0">&nbsp;<font face="Arial,Helvetica"><b>
183     </navbar:prolog>
184     #   ...here the <snb_button> tags will occur...
185     %body
186     #   button epilog (normal)
187     <navbar:epilog>\
188           </font>&nbsp;</td><td>|</td>
189     </navbar:epilog>
190     #   button epilog (selected)
191     <navbar:epilog type=S>\
192           </b></font>&nbsp;</td><td>|</td>
193     </navbar:epilog>
194     #   last button epilog (normal)
195     <navbar:epilog pos=last>\
196           </font>&nbsp;</td><td></td>
197     </navbar:epilog>
198     #   last button epilog (selected)
199     <navbar:epilog type=S pos=last>\
200           </b></font>&nbsp;</td><td></td>
201     </navbar:epilog>
202     #   bar footer
203     <navbar:footer>\
204         </tr>
205       </table>
206     </navbar:footer>
207   </navbar:define>
208   #   2. render the navigation bar and divert
209   #      divert it into it's final location
210   ..PAGE_SUBNAVBAR>>\
211   <navbar:render name=snb select="$(page)">\
212   <<..
213 </define-tag>
214
215 #   define the <snb_button> tag for the <snb> container
216 #   (this is for consistency with the tag names)
217 <define-tag snb_button>
218   <navbar:button %attributes>
219 </define-tag>
220
221 #   predefine the contents of the SNB location
222 #   by diverting a whitespace character to it.
223 #   This prevents the table to be folded.
224 ..PAGE_SUBNAVBAR!>>
225 &nbsp;
226 <<..
227
228 #   and now the final WML trick: When the page=<page_name>
229 #   attribute is specified for this template, we read in the SNB
230 #   spec-file which now can use the <snb>..</snb> and
231 #   <snb_button> tags to actually define and render a SNB. This
232 #   is accomplished by doing some sort of a conditional #include. ;-)
233 $(page:*# )$(page:+#include ")$(SNB_RC:-.wmlsnb)$(page:+")
234
235 ##
236 ##  Useful tags (for convenience purposes only)
237 ##
238
239 #   define a <item> tag for <ul>/<ol> item similar to <li> but
240 #   which is nice for URL lists like the Related area where
241 #   we want a special layout.
242 <define-tag item>
243 <preserve name>
244 <preserve url>
245 <preserve aio>
246 <preserve info>
247 <set-var aio=*>
248 <set-var %attributes>
249 <li><imgdot width=1 height=18>\
250     <a href="<get-var url>"><font size=+1 face="Arial,Helvetica"><b><get-var name></b></font></a>
251     <ifeq "<get-var aio>" "" <img src="aio.gif" alt="[all-in-one]" align=absmiddle>>
252     <br>
253     <a href="<get-var url>"><font size=-1><get-var url></font></a><br>
254     <ifeq "<get-var info>" "" "" "<get-var info>">
255 <restore info>
256 <restore aio>
257 <restore url>
258 <restore name>
259 </define-tag>
260
261 #   define a <filelist> tag which can be used to create a file listing which
262 #   is optically more compact than the stuff Apache's mod_autoindex creates.
263 #   Especially the current version is marked red, too.
264 <define-tag filelist>
265 <pre>
266 <b>   Bytes      Timestamp       Filename</b>
267 <b>________ ____________________ ____________________________</b>
268 <:
269 @HI = ();
270 open(FP, "<index.current");
271 while (<FP>) {
272    s|\s*\n$||;
273    push(@HI, $_);
274 }
275 close(FP);
276 sub ls {
277     my ($pat) = @_;
278     my (@F, @R, $f, @S, @T);
279     @F = sort { (stat($a))[9] <=> (stat($b))[9]; } (glob($pat));
280     @R = ();
281     foreach $f (@F) {
282         next if ($f =~ m|^index.*|);
283         if ('%1' ne '') {
284             if (! %1 $f) {
285                 next;
286             }
287         }
288         @S = stat($f);
289         $f = "$f/" if (-d $f);
290         @T = localtime($S[9]);
291         my @moy = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
292                    'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
293         push(@R, sprintf("%"."8d %"."s %"."2d %"."02d:%"."02d:%"."02d %"."d %"."s\n", 
294              $S[7], $moy[$T[4]], $T[3], $T[2], $T[1], $T[0], 1900+$T[5], $f));
295     }
296     return @R;
297 }
298 @L = &ls("%0");
299 foreach $l (@L) {
300     next if ($l =~ m|^\s*$|);
301     $l =~ s|(\s+)(\S+[^/])(\s*\n)$|$1."<a href=\"$2\">$2</a>".$3|e;
302     $l =~ s|(\s+)(\S+/)(\s*\n)$|$1."<a href=\"$2\"><b>$2</b></a>".$3|e;
303     foreach $hi (@HI) {
304         $l =~ s|^(.*$hi.*)$|<font color="#cc3333">$1&nbsp;&nbsp;<b>[LATEST]</b></font>|;
305         $l =~ s|>($hi)<|><font color="#cc3333">$1</font><|;
306     }
307     print $l;
308 }
309 :>
310 </pre>
311 </define-tag>
312
313 <define-tag rfilelist>
314 <pre>
315 <b>   Bytes      Timestamp       Filename</b>
316 <b>________ ____________________ ____________________________</b>
317 <:
318 @HI = ();
319 open(FP, "<index.current");
320 while (<FP>) {
321    s|\s*\n$||;
322    s/#.*$//;
323    next if (/^\s*$/);
324    # If line is of form "last <regex>" look for last
325    # matching filename in the list.
326    # This means "last openssl-1*.tar.gz" will automatically
327    # mark the last version of OpenSSL as the latest without
328    # the need to manually update index.current on each release.
329    if (/^\s*last\s*(\S+)\s*$/) {
330         # Get list of all file, skip betas
331         my @list = sort grep(!/beta/, glob($1));
332         my $lastfile = pop @list;
333         push(@HI, $lastfile) if (-f $lastfile);
334    } elsif (-f $_) {
335         push(@HI, $_);
336    }
337 }
338 close(FP);
339 sub ls {
340     my ($pat) = @_;
341     my (@F, @R, $f, @S, @T);
342     @F = sort { (stat($b))[9] <=> (stat($a))[9]; } (glob($pat));
343     @R = ();
344     foreach $f (@F) {
345         next if ($f =~ m|^index.*|);
346         if ('%1' ne '') {
347             if (! %1 $f) {
348                 next;
349             }
350         }
351         @S = stat($f);
352         $f = "$f/" if (-d $f);
353         @T = localtime($S[9]);
354         my @moy = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
355                    'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
356         push(@R, sprintf("%"."8d %"."s %"."2d %"."02d:%"."02d:%"."02d %"."d %"."s\n", 
357              $S[7], $moy[$T[4]], $T[3], $T[2], $T[1], $T[0], 1900+$T[5], $f));
358     }
359     return @R;
360 }
361 @L = &ls("%0");
362 foreach $l (@L) {
363     next if ($l =~ m|^\s*$|);
364     if ($l =~ m|(\s+)(\S+[^/])(\s*\n)$|) {
365         my $h = $`.$1;
366         my $f = $2;
367         my $t = $3;
368         my $r = "<a href=\"$f\">$f</a>";
369         if (-f "$f.md5") { $r .= " (<a href=\"$f.md5\">MD5</a>)"; }
370         if (-f "$f.sha1") { $r .= " (<a href=\"$f.sha1\">SHA1</a>)"; }
371         if (-f "$f.asc") { $r .= " (<a href=\"$f.asc\">PGP sign</a>)"; }
372         $l = $h.$r.$t;
373     }
374     $l =~ s|(\s+)(\S+/)(\s*\n)$|$1."<a href=\"$2\"><b>$2</b></a>".$3|e;
375     foreach $hi (@HI) {
376         $l =~ s|^(.*$hi.*)$|<font color="#cc3333">$1&nbsp;&nbsp;<b>[LATEST]</b></font>|;
377         $l =~ s|>($hi)<|><font color="#cc3333">$1</font><|;
378     }
379     print $l;
380 }
381 :>
382 </pre>
383 </define-tag>
384
385 <define-tag notes>
386 <preserve minversion>
387 <preserve maxversion>
388 <preserve filename>
389 <set-var %attributes>
390 <:
391
392 my $minversion = "<get-var minversion>";
393 my $maxversion = "<get-var maxversion>";
394 my $dirname = "<get-var dirname>";
395 my $file;
396 my $custompage = 0;
397
398 if ($maxversion eq "") {
399         $minversion="<get-var WML_SRC_FILENAME>";
400         $minversion =~ s/^.*-(\d+\.\d+\.\d+)-.*$/$1/;
401         $maxversion = $minversion;
402 } else {
403         $custompage = 1;
404 }
405
406
407 my $dir = defined $ENV{PODSHOME} ? "$ENV{PODSHOME}/../.." : "/e/openssl/exp";
408 if ($dirname ne "") {
409         $file = "${dir}/$dirname/NEWS";
410         $custompage = 1;
411 } else {
412         $file = "${dir}/openssl:${minversion}-stable/NEWS";
413 }
414 # For testing
415 $file = $ENV{NEWSTEST} if defined $ENV{NEWSTEST};
416 if ($custompage == 0) {
417         my $brname = $minversion;
418         $brname =~ tr/./_/;
419         $brname = "OpenSSL_${brname}-stable";
420         print <<"END"
421 <title>OpenSSL $minversion Release Notes.</title>
422 <h1>OpenSSL $minversion Branch Release notes</h1>
423
424 The major changes and known issues for the $minversion branch of the OpenSSL
425 toolkit are summarised below. The contents reflect the current state of the
426 <tt>NEWS</tt> file inside the git repository.
427 <p>
428 Additional details of changes can be found in the <a href="http://git.openssl.org/gitweb/?p=openssl.git;a=blob_plain;f=CHANGES;hb=refs/heads/$brname">ChangeLog for OpenSSL $minversion</a>.
429 <p>
430 A complete list of changes to OpenSSL $minversion can be found in the <a href="http://git.openssl.org/gitweb/?p=openssl.git;a=shortlog;h=refs/heads/$brname">git repository commit log</a>.
431 <p>
432
433 END
434 }
435
436 my $copy = 0;
437 my $in_ul = 0;
438 open(FP, "<$file") || die "Can't open $file";
439 while (<FP>) {
440         if (/^\s*Major changes between.*(\d+\.\d+\.\d+)\D.*$/ ||
441                 /^\s*Known issues in.*(\d+\.\d+\.\d+)\D.*$/) {
442                 if ($1 ge $minversion && $1 le $maxversion) {
443                         $copy = 1;
444                         s|^(.*)$|<b>$1</b>|;
445                         if ($in_ul) {
446                                 print "</ul>\n";
447                                 $in_ul = 0;
448                         }
449                 print;
450                 next;
451                 } elsif ($copy) {
452                         last;
453                 }
454         }
455         if ($copy) {
456                 s/&/&amp;/g;
457                 s/</&lt;/g;
458                 s/>/&gt;/g;
459                 if (s/^\s+o\s+/<li>/ && !$in_ul) {
460                         print "<ul>\n";
461                         $in_ul = 1;
462                 }
463                 s/CVE-(\d{4}-\d{4})/<a href=vulnerabilities.html#$1>CVE-$1<\/a>/g;
464         print;
465         }
466         
467 }
468 close(FP);
469 print "</ul>";
470 :>
471 <restore minversion>
472 <restore maxversion>
473 <restore filename>
474 </define-tag>
475
476 #
477 <define-tag newsflash>
478 <preserve from>
479 <preserve max>
480 <preserve more>
481 <set-var %attributes>
482 <table width=550 cellspacing=0 cellpadding=1 border=0>
483 <tr><td><font face="Arial,Helvetica"><b>Date</b></font></td> <td>&nbsp;&nbsp;&nbsp;<font face="Arial,Helvetica"><b>Newsflash</b></font></td></tr>
484 <tr><td><hr noshade size=1></td> <td><hr noshade size=1></td></tr>
485 <:
486     open(FP, "< <get-var from>") || die;
487     my $max = ("<get-var max>" eq '' ? 9999 : "<get-var max>");
488     @COL = (
489         '#ffffff',
490         '#f0f0f0',
491     );
492     $ncol = 1;
493     $n = 0;
494     while (<FP>) {
495         $ncol = ($ncol + 1) % 2;
496         $col  = $COL[$ncol];
497         s|="ROOT|="$(ROOT)|g;
498         if (m|^(.+?):(.+)|) {
499             print "<tr bgcolor=\"$col\">\n";
500             print "  <td align=right><font face=\"Arial,Helvetica\"><b>$1:</b></font></td> <td>&nbsp;&nbsp;$2</td>\n";
501             print "</tr>\n";
502         }
503         $n++;
504         last if ($n >= $max);
505     }
506     close(FP);
507 :>
508 <ifeq "<get-var more>" "" "" <group
509 <tr>
510   <td>&nbsp;</td> <td align=right><a href="<get-var more>">more...</a></td>
511 </tr>
512 >>
513 </table>
514 <restore more>
515 <restore max>
516 <restore from>
517 </define-tag>
518
519 #   define a <disclaimer> tag which displays the usual disclaimer stuff
520 <define-tag disclaimer>
521 <font face="Arial,Helvetica" size=-1>
522 This software package uses strong cryptography, so even if it is created,
523 maintained and distributed from liberal countries in Europe (where it is legal
524 to do this), it falls under certain export/import and/or use restrictions in
525 some other parts of the world.
526 <p>
527 PLEASE REMEMBER THAT EXPORT/IMPORT AND/OR USE OF STRONG CRYPTOGRAPHY
528 SOFTWARE, PROVIDING CRYPTOGRAPHY HOOKS OR EVEN JUST COMMUNICATING TECHNICAL
529 DETAILS ABOUT CRYPTOGRAPHY SOFTWARE IS ILLEGAL IN SOME PARTS OF THE WORLD.
530 SO, WHEN YOU IMPORT THIS PACKAGE TO YOUR COUNTRY, RE-DISTRIBUTE IT FROM
531 THERE OR EVEN JUST EMAIL TECHNICAL SUGGESTIONS OR EVEN SOURCE PATCHES TO THE
532 AUTHOR OR OTHER PEOPLE YOU ARE STRONGLY ADVISED TO PAY CLOSE ATTENTION TO
533 ANY EXPORT/IMPORT AND/OR USE LAWS WHICH APPLY TO YOU. THE AUTHORS OF OPENSSL
534 ARE NOT LIABLE FOR ANY VIOLATIONS YOU MAKE HERE. SO BE CAREFUL, IT
535 IS YOUR RESPONSIBILITY.
536 </font>
537 <p>
538 <font face="Arial,Helvetica" size=-1>
539 CREDIT INFORMATION:
540 This product includes cryptographic software written by Eric Young.  
541 This product includes software written by Tim Hudson (tjh@cryptsoft.com).
542 </font>
543 </define-tag>
544
545 #  a tag displaying the used tools   
546 <define-tag website-tools>
547 <font face="Arial,Helvetica" size=-1> 
548 Website designed by
549 <a href="http://www.engelschall.com/">Ralf S. Engelschall</a>
550 and generated with
551 <a href="http://thewml.org/"><font color="#000000">
552 Website META Language</font></a> (WML).<br>
553 All markup code and graphics on this website
554 are Copyright &copy; 1999-2014 <a href="http://www.openssl.org/">The OpenSSL Project</a>, 
555 All rights reserved.<br>
556 This website is served by an 
557 <a href="http://www.apache.org/"><font color="#000000">Apache</font></a>/
558 <a href="http://www.modssl.org/"><font color="#000000">mod_ssl</font></a>
559 webserver environment.<br>
560 </font>
561 </define-tag>
562
563 #  construct an absolute URL out of a relative URL
564 #  (essential for the mirroring of the website!)
565 <define-tag absolute>
566 <:{
567     my ($cwd, $baseurl, $basedir, $subdir, $page, $url);
568
569     #   determine current working directory
570     $cwd = '<get-var WML_SRC_DIRNAME>';
571
572     #   determine base URL
573     $baseurl = '<get-var BASE_URL>' || 'file://';
574
575     #   determine base directory
576     $basedir = '<get-var BASE_DIR>' || '<get-var WML_SRC_DIRNAME>';
577     $basedir = &canonpath("$cwd/$basedir") if ($basedir !~ m|^/|);
578
579     #   determine subdir from base dir to current working dir
580     $subdir = &relpath($basedir, $cwd);
581
582     #   determine document
583     $page = '%0';
584
585     #   construct final URL
586     $url = "$baseurl/$subdir/$page";
587     $url = &canonurl($url);
588
589     #   replace this tag with the constructed URL
590     print $url;
591 }:>
592 </define-tag>
593
594 ##
595 ##  Finally, the layout is now rendered, so divert all
596 ##  following stuff (the code in the local file after the #use 
597 ##  for this template!) into the white body area.
598 ##
599
600 ..PAGE_BODY>>
601