Mercurial > hg > nginx-site
comparison xsls/dirname.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 | be54c443235a |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:61e04fc01027 |
---|---|
1 X:stylesheet { | |
2 | |
3 | |
4 <!-- return a dirname of an article link --> | |
5 | |
6 X:var DIRNAME = { !dirname (path = "$LINK") } | |
7 | |
8 X:template dirname (path) { | |
9 X:if "contains($path, '/')" { | |
10 !{ substring-before($path, '/') } | |
11 X:text {/} | |
12 !dirname (path = "substring-after($path, '/')") | |
13 } | |
14 } | |
15 | |
16 | |
17 <!-- return a path to the root of an article link, i.e., "../../.." --> | |
18 | |
19 X:var ROOT = { !root (path = { !{ substring($DIRNAME, 2) } }) } | |
20 | |
21 X:template root (path) { | |
22 X:if "contains($path, '/')" { | |
23 X:text {..} | |
24 X:if "substring-after($path, '/')" { | |
25 X:text {/} | |
26 !root (path = "substring-after($path, '/')") | |
27 } | |
28 } | |
29 } | |
30 | |
31 } |