Mercurial > hg > nginx-site
comparison xsls/menu.xsls @ 0:61e04fc01027
Initial import of the nginx.org website.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Thu, 11 Aug 2011 12:19:13 +0000 |
parents | |
children | 202e4424cab8 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:61e04fc01027 |
---|---|
1 X:stylesheet { | |
2 | |
3 X:template = "menu/item" { | |
4 | |
5 <!-- | |
6 -- variables are not allowed in a template match predicate, | |
7 -- therefore, we have to use ugly "if"s instead of elegant | |
8 -- "menu/item[@href = $LINK]", etc. | |
9 --> | |
10 | |
11 X:if "@href = $LINK" { | |
12 X:if "$YEAR and @href='/'" { | |
13 <a href="./"> news </a> <br/> | |
14 } else { | |
15 !{ normalize-space(text()) }<br/> | |
16 } | |
17 | |
18 } else { | |
19 <a> | |
20 X:attribute "href" { | |
21 | |
22 X:if "starts-with(@href, $DIRNAME)" { | |
23 X:if "substring-after(@href, $DIRNAME) = ''" { | |
24 ./ | |
25 | |
26 } else { | |
27 !{ substring-after(@href, $DIRNAME) } | |
28 } | |
29 | |
30 } else { | |
31 !{ concat($ROOT, @href) } | |
32 } | |
33 } | |
34 !{ normalize-space(text()) } | |
35 </a> | |
36 | |
37 X:if "@lang" { X:text { [} !{@lang} X:text {]}} | |
38 | |
39 <br/> | |
40 } | |
41 } | |
42 | |
43 | |
44 X:template = "menu/item[@year]" { | |
45 X:if "$YEAR or $LINK='/'" { | |
46 X:if "$YEAR=@year" { | |
47 !{@year} <br/> | |
48 } else { | |
49 <a href="{@href}"> !{@year} </a> | |
50 <br/> | |
51 } | |
52 } | |
53 } | |
54 | |
55 | |
56 X:template = "menu/item[starts-with(@href, 'http://')]" { | |
57 <a href="{@href}"> !{ normalize-space(text()) } </a> | |
58 X:if "@lang" { X:text { [} !{@lang} X:text {]}} | |
59 <br/> | |
60 } | |
61 | |
62 | |
63 X:template = "menu/item[not(@href)]" { | |
64 !{ normalize-space(text()) } <br/> | |
65 } | |
66 | |
67 } |