Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Community Documentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bio-IT
Community Documentation
Commits
ee8b901b
Commit
ee8b901b
authored
5 years ago
by
Silvio Giebl
Browse files
Options
Downloads
Patches
Plain Diff
Simplified nav nesting
(cherry picked from commit eeb3f342b17a744d0c2b2f0360359fa3276f8abd)
parent
418cf1d6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
_includes/nav.html
+38
-40
38 additions, 40 deletions
_includes/nav.html
_layouts/default.html
+3
-4
3 additions, 4 deletions
_layouts/default.html
with
41 additions
and
44 deletions
_includes/nav.html
+
38
−
40
View file @
ee8b901b
<nav
role=
"navigation"
aria-label=
"Main navigation"
>
<ul
class=
"navigation-list"
>
{%- assign pages_list = site.html_pages | sort:"nav_order" -%}
{%- for node in pages_list -%}
{%- unless node.nav_exclude -%}
{%- if node.parent == nil -%}
<li
class=
"navigation-list-item{% if page.url == node.url or page.parent == node.title or page.grand_parent == node.title %} active{% endif %}"
>
{%- if page.parent == node.title or page.grand_parent == node.title -%}
{%- assign first_level_url = node.url | absolute_url -%}
{%- endif -%}
<a
href=
"{{ node.url | absolute_url }}"
class=
"navigation-list-link{% if page.url == node.url %} active{% endif %}"
>
{{ node.title }}
</a>
{%- if node.has_children -%}
{%- assign children_list = site.html_pages | where: "parent", node.title | sort:"nav_order" -%}
<ul
class=
"navigation-list-child-list "
>
{%- for child in children_list -%}
<li
class=
"navigation-list-item {% if page.url == child.url or page.parent == child.title %} active{% endif %}"
>
{%- if page.url == child.url or page.parent == child.title -%}
{%- assign second_level_url = child.url | absolute_url -%}
{%- endif -%}
<a
href=
"{{ child.url | absolute_url }}"
class=
"navigation-list-link{% if page.url == child.url %} active{% endif %}"
>
{{ child.title }}
</a>
{%- if child.has_children -%}
{%- assign grand_children_list = site.html_pages | where: "parent", child.title | sort:"nav_order" -%}
<ul
class=
"navigation-list-child-list"
>
{%- for grand_child in grand_children_list -%}
<li
class=
"navigation-list-item {% if page.url == grand_child.url %} active{% endif %}"
>
<a
href=
"{{ grand_child.url | absolute_url }}"
class=
"navigation-list-link{% if page.url == grand_child.url %} active{% endif %}"
>
{{ grand_child.title }}
</a>
</li>
{%- endfor -%}
</ul>
{%- endif -%}
</li>
{%- endfor -%}
</ul>
{%- endif -%}
</li>
{%- endif -%}
{%- endunless -%}
{%- endfor -%}
</ul>
</nav>
<ul
class=
"navigation-list"
>
{%- assign pages_list = site.html_pages | sort:"nav_order" -%}
{%- for node in pages_list -%}
{%- unless node.nav_exclude -%}
{%- if node.parent == nil -%}
<li
class=
"navigation-list-item{% if page.url == node.url or page.parent == node.title or page.grand_parent == node.title %} active{% endif %}"
>
{%- if page.parent == node.title or page.grand_parent == node.title -%}
{%- assign first_level_url = node.url | absolute_url -%}
{%- endif -%}
<a
href=
"{{ node.url | absolute_url }}"
class=
"navigation-list-link{% if page.url == node.url %} active{% endif %}"
>
{{ node.title }}
</a>
{%- if node.has_children -%}
{%- assign children_list = site.html_pages | where: "parent", node.title | sort:"nav_order" -%}
<ul
class=
"navigation-list-child-list "
>
{%- for child in children_list -%}
<li
class=
"navigation-list-item {% if page.url == child.url or page.parent == child.title %} active{% endif %}"
>
{%- if page.url == child.url or page.parent == child.title -%}
{%- assign second_level_url = child.url | absolute_url -%}
{%- endif -%}
<a
href=
"{{ child.url | absolute_url }}"
class=
"navigation-list-link{% if page.url == child.url %} active{% endif %}"
>
{{ child.title }}
</a>
{%- if child.has_children -%}
{%- assign grand_children_list = site.html_pages | where: "parent", child.title | sort:"nav_order" -%}
<ul
class=
"navigation-list-child-list"
>
{%- for grand_child in grand_children_list -%}
<li
class=
"navigation-list-item {% if page.url == grand_child.url %} active{% endif %}"
>
<a
href=
"{{ grand_child.url | absolute_url }}"
class=
"navigation-list-link{% if page.url == grand_child.url %} active{% endif %}"
>
{{ grand_child.title }}
</a>
</li>
{%- endfor -%}
</ul>
{%- endif -%}
</li>
{%- endfor -%}
</ul>
{%- endif -%}
</li>
{%- endif -%}
{%- endunless -%}
{%- endfor -%}
</ul>
This diff is collapsed.
Click to expand it.
_layouts/default.html
+
3
−
4
View file @
ee8b901b
...
...
@@ -4,7 +4,7 @@ layout: table_wrappers
<!DOCTYPE html>
<html
lang=
"{{ site.lang | default:
"
en-US
"
}}"
>
<html
lang=
"{{ site.lang | default:
'
en-US
'
}}"
>
{% include head.html %}
<body>
...
...
@@ -14,10 +14,9 @@ layout: table_wrappers
<a
href=
"{{ site.url }}{{ site.baseurl }}"
class=
"site-title lh-tight"
>
{% include title.html %}
</a>
<button
class=
"menu-button fs-3 js-main-nav-trigger"
data-text-toggle=
"Hide"
type=
"button"
>
Menu
</button>
</div>
<div
class=
"navigation main-nav js-main-nav"
>
<nav
role=
"navigation"
aria-label=
"Main navigation"
class=
"navigation main-nav js-main-nav"
>
{% include nav.html %}
</
di
v>
</
na
v>
<footer
class=
"site-footer"
>
<p
class=
"text-small text-grey-dk-000 mb-4"
>
This site uses
<a
href=
"https://github.com/pmarsceill/just-the-docs"
>
Just the Docs
</a>
, a documentation theme for Jekyll.
</p>
</footer>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment