[PATCH 2 of 2] Enhanced website navigation with 2-level menu and directive search

Liam Crilly l.crilly at f5.com
Tue Aug 30 12:55:39 UTC 2022


# HG changeset patch
# User Liam Crilly <liam.crilly at nginx.com>
# Date 1659696358 -3600
#      Fri Aug 05 11:45:58 2022 +0100
# Node ID 8781046c34459c05b4d6f296bbbadc3733d51b17
# Parent  1087570ec093271d10de8e901122c99003a79b6d
Modified layout of navigation menu.

This patch modifies the layout of the menu navigation with several changes:
 - A two-level heirarchy organises content into sections for nginx, other
   nginx projects, and information
 - The "projects" of njs and unit are moved up, to a more prominent position
 - News is moved lower down, to the "info" section. A third menu level
   contains the individual years so that the top of the menu is always the
   same, regardless of which page you are on.
 - Links to external sites are indicated by a right-arrow character

diff -r 1087570ec093 -r 8781046c3445 xml/menu.xml
--- a/xml/menu.xml	Fri Aug 05 11:45:28 2022 +0100
+++ b/xml/menu.xml	Fri Aug 05 11:45:58 2022 +0100
@@ -22,6 +22,7 @@
 <item />
 -->
 
+<item> nginx </item>
 <item href="/" lang="en"> ÐÂÎÅ </item>
 <item href="/cn/"> nginx ½éÉÜ </item>
 <item href="/en/download.html" lang="en"> ÏÂÔØ </item>
@@ -32,14 +33,16 @@
 <item href="/en/support.html" lang="en"> Ö§³Ö </item>
 <item />
 
+<item> projects </item>
+<item href="https://unit.nginx.org/"> unit </item>
+<item href="/en/docs/njs/"> njs </item>
+<item />
+
+<item> info </item>
 <item href="http://trac.nginx.org/nginx"> trac </item>
 <item href="http://twitter.com/nginxorg"> twitter </item>
 <item href="http://nginx.com/blog/"> blog </item>
 <item />
-
-<item href="https://unit.nginx.org/"> unit </item>
-<item href="/en/docs/njs/"> njs </item>
-
 </menu>
 
 
@@ -58,6 +61,22 @@
 <item />
 -->
 
+<item> nginx </item>
+<item href="/en/"> about </item>
+<item href="/en/download.html"> download </item>
+<item href="/en/security_advisories.html"> security </item>
+<item href="/en/docs/"> documentation </item>
+<item href="/en/docs/faq.html"> faq </item>
+<item href="/en/books.html"> books </item>
+<item href="/en/support.html"> support </item>
+<item />
+
+<item> projects </item>
+<item href="/en/docs/njs/"> njs </item>
+<item href="https://unit.nginx.org/"> unit </item>
+<item />
+
+<item> info </item>
 <item href="/"> news </item>
 <item href="2021.html" year="2021" />
 <item href="2020.html" year="2020" />
@@ -74,23 +93,11 @@
 <item href="2009.html" year="2009" />
 <item year="" />
 
-<item href="/en/"> about </item>
-<item href="/en/download.html"> download </item>
-<item href="/en/security_advisories.html"> security </item>
-<item href="/en/docs/"> documentation </item>
-<item href="/en/docs/faq.html"> faq </item>
-<item href="/en/books.html"> books </item>
-<item href="/en/support.html"> support </item>
-<item />
-
 <item href="http://trac.nginx.org/nginx"> trac </item>
 <item href="http://twitter.com/nginxorg"> twitter </item>
 <item href="https://www.nginx.com/blog/"> blog </item>
 <item />
 
-<item href="https://unit.nginx.org/"> unit </item>
-<item href="/en/docs/njs/"> njs </item>
-
 </menu>
 
 
@@ -144,6 +151,7 @@
 <item />
 -->
 
+<item> nginx </item>
 <item href="/" lang="en"> ¥Ë¥å©`¥¹ </item>
 <item href="/ja/"> nginx ¤Ë¤Ä¤¤¤Æ </item>
 <item href="/en/download.html" lang="en"> ¥À¥¦¥ó¥í©`¥É </item>
@@ -154,14 +162,16 @@
 <item href="/en/support.html" lang="en"> ¥µ¥Ý©`¥È </item>
 <item />
 
+<item> projects </item>
+<item href="https://unit.nginx.org/"> unit </item>
+<item href="/en/docs/njs/"> njs </item>
+<item />
+
 <item href="http://trac.nginx.org/nginx"> trac </item>
 <item href="http://twitter.com/nginxorg"> twitter </item>
 <item href="http://nginx.com/blog/"> blog </item>
 <item />
 
-<item href="https://unit.nginx.org/"> unit </item>
-<item href="/en/docs/njs/"> njs </item>
-
 </menu>
 
 
@@ -180,6 +190,7 @@
 <item />
 -->
 
+<item> nginx </item>
 <item href="/" lang="en"> §ß§à§Ó§à§ã§ä§Ú </item>
 <item href="/ru/"> §à§Ò nginx </item>
 <item href="/ru/download.html"> §ã§Ü§Ñ§é§Ñ§ä§î </item>
@@ -190,14 +201,17 @@
 <item href="/ru/support.html"> §á§à§Õ§Õ§Ö§â§Ø§Ü§Ñ </item>
 <item />
 
+<item> §á§â§à§Ö§Ü§ä§í </item>
+<item href="https://unit.nginx.org/" lang="en"> unit </item>
+<item href="/ru/docs/njs/"> njs </item>
+<item />
+
+<item> §Ú§ß§æ§à§â§Þ§Ñ§è§Ú§ñ </item>
 <item href="http://trac.nginx.org/nginx"> trac </item>
 <item href="http://twitter.com/nginxorg"> twitter </item>
 <item href="https://www.nginx.com/blog/"> blog </item>
 <item />
 
-<item href="https://unit.nginx.org/"> unit </item>
-<item href="/ru/docs/njs/"> njs </item>
-
 </menu>
 
 
diff -r 1087570ec093 -r 8781046c3445 xsls/menu.xsls
--- a/xsls/menu.xsls	Fri Aug 05 11:45:28 2022 +0100
+++ b/xsls/menu.xsls	Fri Aug 05 11:45:58 2022 +0100
@@ -15,9 +15,9 @@
 
     X:if "@href = $LINK" {
         X:if "$YEAR and @href='/'" {
-            <a href="./"> news </a> <br/>
+              <a href="./"> news </a> <br/>
         } else {
-            !{ normalize-space(text()) }<br/>
+              !{ normalize-space(text()) }<br/>
         }
 
     } else {
@@ -47,7 +47,7 @@
             }
         } else {
 
-            <a>
+              <a>
             X:attribute "href" {
 
                 X:if "starts-with(@href, $DIRNAME)" {
@@ -75,9 +75,9 @@
 X:template = "menu/item[@year]" {
     X:if "$YEAR or $LINK='/'" {
         X:if "$YEAR=@year" {
-            !{@year} <br/>
+                !{@year} <br/>
         } else {
-            X:if "@href" { <a href="{@href}"> !{@year} </a> }
+            X:if "@href" {     <a href="{@href}"> !{@year} </a> }
             <br/>
         }
     }
@@ -85,7 +85,7 @@
 
 
 X:template = "menu/item[starts-with(@href, 'http://') or starts-with(@href, 'https://')]" {
-    <a href="{@href}"> !{ normalize-space(text()) } </a>
+      <a href="{@href}"> !{ normalize-space(text()) } </a>→
     X:if "@lang" { X:text { [} !{@lang} X:text {]}}
     <br/>
 }


More information about the nginx-devel mailing list