Skip to content

Commit 582b413

Browse files
committed
Regenerated.
1 parent 38e7016 commit 582b413

File tree

4 files changed

+105
-23
lines changed

4 files changed

+105
-23
lines changed

xslt/article.xslt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<xsl:include href="download.xslt"/>
3535
<xsl:include href="security.xslt"/>
3636
<xsl:include href="versions.xslt"/>
37-
37+
<xsl:include href="projects.xslt"/>
3838

3939
<xsl:template match="/article | /module">
4040
<html>

xslt/menu.xslt

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
88

99
<xsl:template match="menu/item">
10-
1110
<!--
1211
.. variables are not allowed in a template match predicate,
1312
.. therefore, we have to use ugly "if"s instead of elegant
@@ -17,11 +16,7 @@
1716
<li>
1817

1918
<xsl:choose><xsl:when test="@href = $LINK">
20-
<xsl:choose><xsl:when test="$YEAR and @href='/'">
21-
<a href="./"> news </a> <br/>
22-
</xsl:when><xsl:otherwise>
23-
<xsl:value-of select=" normalize-space(text()) "/><br/>
24-
</xsl:otherwise></xsl:choose>
19+
<xsl:value-of select=" normalize-space(text()) "/><br/>
2520

2621
</xsl:when><xsl:otherwise>
2722
<!--
@@ -73,19 +68,6 @@
7368
</xsl:template>
7469

7570

76-
<xsl:template match="menu/item[@year]">
77-
<xsl:if test="$YEAR or $LINK='/'">
78-
<li>
79-
<xsl:choose><xsl:when test="$YEAR=@year">
80-
<xsl:value-of select="@year"/>
81-
</xsl:when><xsl:otherwise>
82-
<xsl:if test="@href"> <a href="{@href}"> <xsl:value-of select="@year"/> </a> </xsl:if>
83-
</xsl:otherwise></xsl:choose>
84-
</li>
85-
</xsl:if>
86-
</xsl:template>
87-
88-
8971
<xsl:template match="menu/item[starts-with(@href, 'http://') or starts-with(@href, 'https://')]">
9072
<li>
9173
<a href="{@href}"> <xsl:value-of select=" normalize-space(text()) "/> </a>
@@ -94,7 +76,7 @@
9476
</xsl:template>
9577

9678

97-
<xsl:template match="menu/item[not(@href) and not(@year)]">
79+
<xsl:template match="menu/item[not(@href)]">
9880
<li><xsl:value-of select=" normalize-space(text()) "/> <br/></li>
9981
</xsl:template>
10082

xslt/news.xslt

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,48 @@
4343
<xsl:call-template name="body"><xsl:with-param select="@lang" name="lang"/></xsl:call-template></html>
4444
</xsl:template>
4545

46+
<xsl:template match="years/year[@year]">
47+
<xsl:if test="position() = 1">
48+
<xsl:text disable-output-escaping="yes">
49+
&lt;div class="dropdown"&gt;
50+
&lt;button class="dropbtn"&gt;news archive ▾&lt;/button&gt;
51+
&lt;div class="dropdown-content"&gt;
52+
</xsl:text>
53+
</xsl:if>
54+
55+
<xsl:if test="position() != last()">
56+
<xsl:choose><xsl:when test="$YEAR=@year">
57+
<b><a href="{@href}"><xsl:value-of select="@year"/></a></b>
58+
</xsl:when><xsl:otherwise>
59+
<a href="{@href}"><xsl:value-of select="@year"/></a>
60+
</xsl:otherwise></xsl:choose>
61+
</xsl:if>
62+
63+
<xsl:if test="position() = last()">
64+
<xsl:choose><xsl:when test="$YEAR=@year">
65+
<b><a href="{@href}"><xsl:value-of select="@year"/></a></b>
66+
</xsl:when><xsl:otherwise>
67+
<a href="{@href}"><xsl:value-of select="@year"/></a>
68+
</xsl:otherwise></xsl:choose>
69+
<xsl:text disable-output-escaping="yes">
70+
&lt;/div&gt;&lt;/div&gt;
71+
</xsl:text>
72+
</xsl:if>
73+
</xsl:template>
4674

4775
<xsl:template match="event">
4876

4977
<xsl:variable name="year"> <xsl:value-of select="substring(../event[position()=1]/@date, 1, 4)"/> </xsl:variable>
5078
<xsl:variable name="y"> <xsl:value-of select="substring(@date, 1, 4)"/> </xsl:variable>
5179

52-
<xsl:if test="position() = 1">
80+
<!-- News items start at position 2 so that we skip the dropdown menu -->
81+
<xsl:if test="position() = 2">
5382
<xsl:text disable-output-escaping="yes">
5483
&lt;table class="news"&gt;
5584
</xsl:text>
5685
</xsl:if>
5786

58-
<xsl:if test="(not($YEAR) and ($year = $y or position() &lt; 11)) or $YEAR=$y">
87+
<xsl:if test="(not($YEAR) and ($year = $y or position() &lt; 12)) or $YEAR=$y">
5988
<tr>
6089
<td class="date">
6190
<a name="{@date}"/> <xsl:value-of select="@date"/>

xslt/projects.xslt

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (C) Nginx, Inc.
4+
-->
5+
6+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
7+
8+
<xsl:template match="topnews">
9+
<xsl:text disable-output-escaping="yes">
10+
&lt;table class="news"&gt;
11+
</xsl:text>
12+
<xsl:apply-templates select="document(concat($XML, '/index.xml'))"/>
13+
<xsl:text disable-output-escaping="yes">
14+
&lt;/table&gt;
15+
</xsl:text>
16+
</xsl:template>
17+
18+
<xsl:template match="event">
19+
20+
<xsl:variable name="year"> <xsl:value-of select="substring(../event[position()=1]/@date, 1, 4)"/> </xsl:variable>
21+
<xsl:variable name="y"> <xsl:value-of select="substring(@date, 1, 4)"/> </xsl:variable>
22+
23+
<!--
24+
This expression displays only the top 4 news items.
25+
We stop at position 12 because there are non-news items above.
26+
-->
27+
<xsl:if test="position() &lt; 12">
28+
<tr>
29+
<td class="date">
30+
<a name="{@date}"/> <xsl:value-of select="@date"/>
31+
</td>
32+
<td> <xsl:apply-templates select="para"/> </td>
33+
</tr>
34+
</xsl:if>
35+
36+
<xsl:if test="position() = last()">
37+
<xsl:text disable-output-escaping="yes">
38+
&lt;/table&gt;
39+
</xsl:text>
40+
</xsl:if>
41+
</xsl:template>
42+
43+
<xsl:template match="projects"> <div class="projects"> <xsl:apply-templates/> </div> </xsl:template>
44+
45+
<xsl:template match="project">
46+
47+
<table>
48+
49+
<tr>
50+
<td width="90px" align="center" valign="bottom">
51+
<a href="{@docs}" valign="top">
52+
<img src="{@logo}" width="38px" alt="{@title} logo"/>
53+
</a>
54+
<h5> <xsl:value-of select="@title"/> </h5>
55+
</td>
56+
57+
<td valign="bottom">
58+
<xsl:value-of select="@description"/> <br/>
59+
<a href="{@docs}">Docs</a> •
60+
<a href="{@repo}">Code</a>
61+
</td>
62+
</tr>
63+
64+
<tr>
65+
<td colspan="2"><br/></td>
66+
</tr>
67+
68+
</table>
69+
</xsl:template>
70+
71+
</xsl:stylesheet>

0 commit comments

Comments
 (0)