Mercurial > hg > nginx-site
annotate xslt/news.xslt @ 2925:3be061a0941a
Added link to varindex in njs Reference.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Thu, 05 Jan 2023 16:34:01 +0000 |
parents | c704a743f269 |
children | 91a2ee74ca72 |
rev | line source |
---|---|
170 | 1 <?xml version="1.0" encoding="utf-8"?> |
1085 | 2 <!-- |
3 Copyright (C) Igor Sysoev | |
4 Copyright (C) Nginx, Inc. | |
5 --> | |
6 | |
170 | 7 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> |
8 | |
1085 | 9 <xsl:output method="html" version="4.0" indent="no" encoding="utf-8"/> |
170 | 10 |
1085 | 11 <xsl:strip-space elements="*"/> |
707 | 12 |
1085 | 13 <!-- |
14 .. a current directory of a XSLT script is where the script is stored, | |
15 .. but not where XSLT processor has been started to run the script | |
16 --> | |
17 <xsl:param select="'../xml'" name="XML"/> | |
18 <xsl:param name="YEAR"/> | |
19 <xsl:param name="ORIGIN"/> | |
20 <xsl:param name="TRANS"/> | |
170 | 21 |
1085 | 22 <xsl:variable select="'http://nginx.org'" name="SITE"/> |
23 <xsl:variable select="/news/@link" name="LINK"/> | |
24 <xsl:variable select="/news/@lang" name="LANG"/> | |
170 | 25 |
1085 | 26 <xsl:include href="dirname.xslt"/> |
27 <xsl:include href="link.xslt"/> | |
28 <xsl:include href="style.xslt"/> | |
29 <xsl:include href="body.xslt"/> | |
30 <xsl:include href="menu.xslt"/> | |
2846
fdf1464e1977
Moved banner to the external file to make partial rollout possible.
Sergey Budnevitch <sb@waeme.net>
parents:
1085
diff
changeset
|
31 <xsl:include href="banner.xslt"/> |
1085 | 32 <xsl:include href="content.xslt"/> |
170 | 33 |
34 | |
1085 | 35 <xsl:template match="/news"> |
36 <html><head> | |
170 | 37 |
1085 | 38 <link rel="alternate" type="application/rss+xml" title="{@name}" href="{$SITE}/index.rss"/> |
170 | 39 |
1085 | 40 <title> <xsl:value-of select="@name"/> <xsl:if test="$YEAR"> <xsl:text>: </xsl:text> <xsl:value-of select="$YEAR"/> </xsl:if> </title> |
41 | |
2875
c704a743f269
Removed google analytics.
Sergey Budnevitch <sb@waeme.net>
parents:
2846
diff
changeset
|
42 <xsl:call-template name="style"><xsl:with-param select="@lang" name="lang"/></xsl:call-template><xsl:call-template name="banner"/></head> |
170 | 43 |
1085 | 44 <xsl:call-template name="body"><xsl:with-param select="@lang" name="lang"/></xsl:call-template></html> |
45 </xsl:template> | |
170 | 46 |
47 | |
1085 | 48 <xsl:template match="event"> |
170 | 49 |
1085 | 50 <xsl:variable name="year"> <xsl:value-of select="substring(../event[position()=1]/@date, 1, 4)"/> </xsl:variable> |
51 <xsl:variable name="y"> <xsl:value-of select="substring(@date, 1, 4)"/> </xsl:variable> | |
170 | 52 |
1085 | 53 <xsl:if test="position() = 1"> |
54 <xsl:text disable-output-escaping="yes"> | |
170 | 55 <table class="news"> |
56 </xsl:text> | |
1085 | 57 </xsl:if> |
170 | 58 |
1085 | 59 <xsl:if test="(not($YEAR) and ($year = $y or position() < 11)) or $YEAR=$y"> |
60 <tr> | |
61 <td class="date"> | |
62 <a name="{@date}"/> <xsl:value-of select="@date"/> | |
63 </td> | |
64 <td> <xsl:apply-templates select="para"/> </td> | |
65 </tr> | |
66 </xsl:if> | |
170 | 67 |
1085 | 68 <xsl:if test="position() = last()"> |
69 <xsl:text disable-output-escaping="yes"> | |
170 | 70 </table> |
71 </xsl:text> | |
1085 | 72 </xsl:if> |
73 </xsl:template> | |
74 | |
170 | 75 |
76 </xsl:stylesheet> |