Mercurial > hg > nginx-site
changeset 604:b2db67ca29cc
Made a link to original relative.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Fri, 20 Jul 2012 13:14:50 +0000 |
parents | e0544f2c4a70 |
children | bfdc7833085a |
files | GNUmakefile xsls/body.xsls xsls/link.xsls |
diffstat | 3 files changed, 15 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/GNUmakefile Fri Jul 20 13:03:52 2012 +0000 +++ b/GNUmakefile Fri Jul 20 13:14:50 2012 +0000 @@ -23,10 +23,10 @@ define XSLT xmllint --noout --valid $2 xsltproc -o $3 \ - $(shell f=`echo $2 | sed 's;^xml/[^/]*/;xml/en/;'`; \ - [ -f $$f ] && echo --stringparam ORIGIN "../$$f") \ - $(shell echo $4 \ - | sed -e "s/\([^= ]*\)=\([^= ]*\)/--param \1 \"'\2'\"/g") \ + $(shell f=`echo $2 | sed 's,^xml/,,;s,[^/]*/,en/,'`; \ + [ -f xml/$$f ] && echo --stringparam ORIGIN "$$f") \ + $(shell p="$4"; [ -n "$$p" ] && \ + echo --stringparam $${p%%=*} $${p#*=}) \ $1 $2 endef
--- a/xsls/body.xsls Fri Jul 20 13:03:52 2012 +0000 +++ b/xsls/body.xsls Fri Jul 20 13:14:50 2012 +0000 @@ -39,8 +39,10 @@ <tr><td valign="top"> - X:if "$ORIGIN and document($ORIGIN)/*/@rev and - (not(@rev) or @rev != document($ORIGIN)/*/@rev)" { + X:if "$ORIGIN and document(concat($XML, '/', $ORIGIN))/*/@rev and + (not(@rev) or + @rev != document(concat($XML, '/', $ORIGIN))/*/@rev)" + { <span> X:if "@lang = 'he'" { X:attribute "class" { X:text{ltr} } }
--- a/xsls/link.xsls Fri Jul 20 13:03:52 2012 +0000 +++ b/xsls/link.xsls Fri Jul 20 13:14:50 2012 +0000 @@ -8,7 +8,13 @@ X:template = "img" { <img src="{@href}"> !!; </img> } X:template = "origin" { - <a href="{document($ORIGIN)/*/@link}"> !!; </a> + <a> + X:attribute "href" { + !root(path = "$ORIGIN") + !{ concat(substring-before($ORIGIN, '.xml'), '.html') } + } + !!; + </a> } X:template = "link[@url]" {