Merge branch '17301-cwl-oom' refs #17301
[arvados.git] / doc / _includes / _navbar_left.liquid
index 92d2082a849417260089c9f66205929879d21c85..2e18980f238741f062b78965050ee7833c913a2b 100644 (file)
@@ -1,20 +1,50 @@
-<div class="span3">
-  <div class="affix-top">
-    <div class="well sidebar-nav">
-      <ol class="nav nav-list">
-        {% for section in site.navbar[page.navsection] %}
-        {% for entry in section %}
-       <li><span class="nav-header">{{ entry[0] }}</span>
-         <ol class="nav nav-list">
-          {% for item in entry[1] %}        
+{% comment %}
+Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: CC-BY-SA-3.0
+{% endcomment %}
+
+{% assign highlighturl = "" %}
+{% for section in site.navbar[page.navsection] %}
+  {% for entry in section %}
+    {% comment %}
+    Want to highlight the current page on the left nav.
+    But some pages have been renamed with a symlink from the old page to the new one.
+    Then the URL won't match.
+    So if the URL doesn't match, as a fallback look for a page with a matching title.
+    {% endcomment %}
+
+    {% for item in entry[1] %}
+      {% if site.pages[item].url == page.url %}
+        {% assign highlighturl = site.pages[item].url %}
+      {% endif %}
+    {% endfor %}
+
+    {% if highlighturl == "" %}
+      {% for item in entry[1] %}
+        {% if site.pages[item].title == page.title %}
+          {% assign highlighturl = site.pages[item].url %}
+        {% endif %}
+      {% endfor %}
+    {% endif %}
+  {% endfor %}
+{% endfor %}
+
+<div class="col-sm-3">
+  <div class="well">
+    <ol class="nav nav-list">
+      {% for section in site.navbar[page.navsection] %}
+      {% for entry in section %}
+      <li><span class="nav-header">{{ entry[0] }}</span>
+       <ol class="nav nav-list">
+          {% for item in entry[1] %}
             {% assign p = site.pages[item] %}
-            <li {% if p.url == page.url %} class="active activesubnav" {% elsif p.title == page.subnavsection %} class="activesubnav" {% endif %}>
+            <li {% if p.url == highlighturl %} class="active activesubnav" {% elsif p.title == page.subnavsection %} class="activesubnav" {% endif %}>
               <a href="{{ site.baseurl }}{{ p.url }}">{{ p.title }}</a></li>
           {% endfor %}
-          </ol>
+        </ol>
         {% endfor %}
         {% endfor %}
-      </ol>
-    </div>
+    </ol>
   </div>
 </div>