Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
www
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard Marcus
www
Commits
829d4882
Unverified
Commit
829d4882
authored
7 years ago
by
Tom Wiesing
Browse files
Options
Downloads
Patches
Plain Diff
Optimize the menu a lot
parent
d1b38277
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
_includes/header.html
+0
-8
0 additions, 8 deletions
_includes/header.html
_includes/menu_sub.html
+13
-44
13 additions, 44 deletions
_includes/menu_sub.html
_includes/print_number.liquid
+0
-10
0 additions, 10 deletions
_includes/print_number.liquid
with
13 additions
and
62 deletions
_includes/header.html
+
0
−
8
View file @
829d4882
...
...
@@ -22,14 +22,6 @@
<a
href=
"{{ site.baseurl }}/"
><img
src=
"{{ site.baseurl }}/public/kwarc_logo.svg"
width=
"180px"
height=
"180px"
></a>
</div>
</li>
{% capture page_priors %}
{% for page in site.pages %}
{% assign value = page.menu_order %}
{% include print_number.liquid %},
{% endfor %}
{% endcapture %}
{% assign page_priors = page_priors | normalize_whitespace | replace: " ", "" | split:"," | uniq | sort | join: "," | append: "," %}
{% for item in site.menu | sort:"menu_order %}
{% if item.folder %}
...
...
This diff is collapsed.
Click to expand it.
_includes/menu_sub.html
+
13
−
44
View file @
829d4882
{% comment %}
This page creates a submenu item. It expects an appropriate `item` as argument.
Furthermore, it requires the page_priors global variable
{% endcomment %}
{% unless item.menu_hidden %}
...
...
@@ -18,22 +17,18 @@
{% assign menu_active = true %}
{% endif %}
<!-- find all our priorities and also check for activity -->
{% capture priors %}
{{ page_priors }}
<!-- check if we are in the current oder -->
{% for item in item.items %}
{% unless item.menu_page %}
{% unless item.external_page %}
{% if item.url == page.url %}
{% assign menu_active = true %}
{% endif %}
{% unless item.menu_page %}
{% unless item.external_page %}
{% if item.url == page.url %}
{% assign menu_active = true %}
{% endif %}
{% endunless %}
{% endunless %}
{% endunless %}
{% assign value = item.menu_order %}
{% include print_number.liquid %},
{% endfor %}
{% endcapture %}
{% assign p
riors = priors | normalize_wh
ite
s
pa
ce | replace: " ", "" | split:"," | uniq | sort
%}
{% assign p
ages = s
ite
.
pa
ges | sort: "menu_order"
%}
<!-- Find the current folder -->
{% assign item_folder = item.folder %}
...
...
@@ -50,21 +45,9 @@
</a>
<div
class=
"collapsible-body"
>
<ul>
<!-- Start by iteratig over the priorities -->
{% for p in priors %}
<!-- If we have folders, iterate over them -->
{% if item.folder %}
{% for item in site.pages %}
<!-- read item priority -->
{% assign value = item.menu_order %}
{% capture ip %}{% include print_number.liquid %}{% endcapture %}
{% assign ip = ip | normalize_whitespace | replace: " ", "" %}
<!-- pick all the ones with the current priority -->
{% if ip == p %}
{% for item in pages %}
<!-- get the current page -->
{% assign sub_parts = item.url | split: '/' %}
{% assign sub_url = sub_parts | last %}
...
...
@@ -74,30 +57,16 @@
{% if sub_folder == item_folder %}
{% include menu_single.html %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
<!-- if we have items, iterate over them -->
{% if item.items %}
{% for item in item.items %}
<!-- read item priority -->
{% assign value = item.menu_order %}
{% capture ip %}{% include print_number.liquid %}{% endcapture %}
{% assign ip = ip | normalize_whitespace | replace: " ", "" %}
<!-- pick all the ones with the current priority -->
{% if ip == p %}
{% include menu_single.html %}
{% endif %}
{% assign sitems = item.items | sort: "menu_order"%}
{% for item in sitems %}
{% include menu_single.html %}
{% endfor %}
{% endif %}
{% endfor %}
</ul>
</div>
</li>
...
...
This diff is collapsed.
Click to expand it.
_includes/print_number.liquid
deleted
100644 → 0
+
0
−
10
View file @
d1b38277
{%
if
value
==
null
%}
{%
assign
value
=
site
.
defaults
[
0
].
values
[
"menu_order"
]
%}
{%
endif
%}
{%
if
value
<
10
%}
0
{%
endif
%}
{%
if
value
<
100
%}
0
{%
endif
%}
{%
if
value
<
1000
%}
0
{%
endif
%}
{%
if
value
<
10000
%}
0
{%
endif
%}
{{
value
}}
\ No newline at end of file
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