Mercurial > hg > nginx-site
annotate xslt/body.xslt @ 2846:fdf1464e1977
Moved banner to the external file to make partial rollout possible.
An idea is to have several banners and show them with different probability
specified by split directive in the nginx.conf
author | Sergey Budnevitch <sb@waeme.net> |
---|---|
date | Tue, 10 May 2022 18:07:27 +0400 |
parents | 5bbae5b15948 |
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:template name="body"><xsl:param name="lang"/> |
170 | 10 |
1085 | 11 <xsl:variable name="MENU_ALIGN"> |
12 <xsl:choose><xsl:when test="$lang = 'he'"> <xsl:text>left</xsl:text> </xsl:when><xsl:otherwise> <xsl:text>right</xsl:text> </xsl:otherwise></xsl:choose> | |
13 </xsl:variable> | |
694 | 14 |
1085 | 15 <xsl:variable name="INDEX_ALIGN"> |
16 <xsl:choose><xsl:when test="$lang = 'he'"> <xsl:text>right</xsl:text> </xsl:when><xsl:otherwise> <xsl:text>left</xsl:text> </xsl:otherwise></xsl:choose> | |
17 </xsl:variable> | |
694 | 18 |
1085 | 19 <body> |
1313 | 20 |
21 <div id="banner"> | |
22 </div> | |
23 | |
24 <div id="main"> | |
25 <div id="menu"> | |
26 <h1> | |
1085 | 27 <xsl:if test="@lang = 'he'"> <xsl:attribute name="align"> <xsl:text>left</xsl:text> </xsl:attribute> </xsl:if> |
1313 | 28 <a href="/"> |
29 <img src="/nginx.png" alt="nginx"/> | |
1085 | 30 </a> |
1313 | 31 </h1> |
32 <div> | |
33 <xsl:apply-templates select="document(concat($XML, '/menu.xml')) | |
34 /menus/menu[@lang = $lang]/item"/> | |
35 </div> | |
36 </div> | |
694 | 37 |
1313 | 38 <div id="content"> |
39 <h2> | |
40 <xsl:value-of select="@name"/> <xsl:if test="$YEAR"> <xsl:text>: </xsl:text> <xsl:value-of select="$YEAR"/> </xsl:if> | |
41 </h2> | |
170 | 42 |
1085 | 43 <xsl:if test="$ORIGIN and document(concat($XML, '/', $ORIGIN))/*/@rev and |
44 (not(@rev) or | |
45 @rev != document(concat($XML, '/', $ORIGIN))/*/@rev)"> | |
46 <span> | |
170 | 47 |
1085 | 48 <xsl:if test="@lang = 'he'"> <xsl:attribute name="class"> <xsl:text>ltr</xsl:text> </xsl:attribute> </xsl:if> |
170 | 49 |
1085 | 50 <blockquote class="note"> |
601 | 51 |
1085 | 52 <xsl:choose><xsl:when test="document(concat($XML, '/i18n.xml')) |
53 /i18n/text[@lang = $lang]/item[@id='outdated']"> | |
54 <xsl:apply-templates select="document(concat($XML, '/i18n.xml')) | |
55 /i18n/text[@lang = $lang]/item[@id='outdated']"/> | |
56 </xsl:when><xsl:otherwise> | |
57 <xsl:apply-templates select="document(concat($XML, '/i18n.xml')) | |
58 /i18n/text[@lang = 'en']/item[@id='outdated']"/> | |
59 </xsl:otherwise></xsl:choose> | |
601 | 60 |
1085 | 61 </blockquote> |
62 </span> | |
63 </xsl:if> | |
601 | 64 |
1085 | 65 <xsl:if test="@toc = 'yes' and section[@id and @name]"> |
66 <table width="100%"><tr><td align="{$INDEX_ALIGN}"> | |
67 <xsl:for-each select="section[@id and @name]"> | |
68 <a href="#{@id}"> <xsl:value-of select="@name"/> </a><br/> | |
69 <xsl:for-each select="section[@id and @name]"> | |
70 <xsl:text>     </xsl:text> | |
71 <a href="#{@id}"> <xsl:value-of select="@name"/> </a><br/> | |
72 </xsl:for-each> | |
73 <xsl:if test="@id = 'directives'"> | |
74 <xsl:for-each select="directive[@name]"> | |
75 <xsl:text>     </xsl:text> | |
76 <a href="#{@name}"> <xsl:value-of select="@name"/> </a><br/> | |
77 </xsl:for-each> | |
78 </xsl:if> | |
2028
5c55b7054b58
Updated docs for the upcoming NGINX Plus release.
Ruslan Ermilov <ru@nginx.com>
parents:
2020
diff
changeset
|
79 <xsl:if test="@id = 'endpoints'"> |
5c55b7054b58
Updated docs for the upcoming NGINX Plus release.
Ruslan Ermilov <ru@nginx.com>
parents:
2020
diff
changeset
|
80 <xsl:for-each select="para/list/tag-name[@name]"> |
5c55b7054b58
Updated docs for the upcoming NGINX Plus release.
Ruslan Ermilov <ru@nginx.com>
parents:
2020
diff
changeset
|
81 <xsl:text>     </xsl:text> |
5c55b7054b58
Updated docs for the upcoming NGINX Plus release.
Ruslan Ermilov <ru@nginx.com>
parents:
2020
diff
changeset
|
82 <a href="#{@id}"> <xsl:value-of select="@name"/> </a><br/> |
5c55b7054b58
Updated docs for the upcoming NGINX Plus release.
Ruslan Ermilov <ru@nginx.com>
parents:
2020
diff
changeset
|
83 </xsl:for-each> |
5c55b7054b58
Updated docs for the upcoming NGINX Plus release.
Ruslan Ermilov <ru@nginx.com>
parents:
2020
diff
changeset
|
84 </xsl:if> |
5c55b7054b58
Updated docs for the upcoming NGINX Plus release.
Ruslan Ermilov <ru@nginx.com>
parents:
2020
diff
changeset
|
85 |
1085 | 86 </xsl:for-each> |
87 </td></tr></table> | |
88 </xsl:if> | |
170 | 89 |
1085 | 90 <xsl:apply-templates/> |
170 | 91 |
1085 | 92 <xsl:if test="@author or @editor or @translator"> |
93 <table width="100%"><tr><td align="right"> | |
170 | 94 |
1085 | 95 <xsl:if test="@author"> |
96 <xsl:value-of select="document(concat($XML, '/i18n.xml')) | |
97 /i18n/text[@lang = $lang]/item[@id='author']"/> | |
98 <xsl:text> </xsl:text> <xsl:value-of select="@author"/> <br/> | |
99 </xsl:if> | |
170 | 100 |
1085 | 101 <xsl:if test="@editor"> |
102 <xsl:value-of select="document(concat($XML, '/i18n.xml')) | |
103 /i18n/text[@lang = $lang]/item[@id='editor']"/> | |
104 <xsl:text> </xsl:text> <xsl:value-of select="@editor"/> <br/> | |
105 </xsl:if> | |
170 | 106 |
1085 | 107 <xsl:if test="@translator"> |
108 <xsl:value-of select="document(concat($XML, '/i18n.xml')) | |
109 /i18n/text[@lang = $lang]/item[@id='translator']"/> | |
110 <xsl:text> </xsl:text> <xsl:value-of select="@translator"/> <br/> | |
111 </xsl:if> | |
170 | 112 |
1085 | 113 </td></tr></table> |
114 </xsl:if> | |
1313 | 115 </div> |
116 </div> | |
1085 | 117 </body> |
170 | 118 |
1085 | 119 </xsl:template> |
170 | 120 |
722 | 121 </xsl:stylesheet> |