Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Open WIN Community
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-science
community
Open WIN Community
Commits
cfbdee11
Commit
cfbdee11
authored
4 years ago
by
PLanCompS
Browse files
Options
Downloads
Patches
Plain Diff
Update nav.html
Fixed conversion of numeric titles to strings.
parent
cff0254d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
_includes/nav.html
+4
-3
4 additions, 3 deletions
_includes/nav.html
with
4 additions
and
3 deletions
_includes/nav.html
+
4
−
3
View file @
cfbdee11
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
{%- comment -%}
{%- comment -%}
The nav_ordered_pages have to be added to number_ordered_pages and
The nav_ordered_pages have to be added to number_ordered_pages and
string_ordered_pages, depending on the nav_order value.
string_ordered_pages, depending on the nav_order value.
The first character of jsonify is `"` only for strings.
The first character of
the
jsonify
result
is `"` only for strings.
{%- endcomment -%}
{%- endcomment -%}
{%- assign nav_ordered_groups = nav_ordered_pages
{%- assign nav_ordered_groups = nav_ordered_pages
| group_by_exp:"item", "item.nav_order | jsonify | slice: 0" -%}
| group_by_exp:"item", "item.nav_order | jsonify | slice: 0" -%}
...
@@ -39,12 +39,13 @@
...
@@ -39,12 +39,13 @@
{%- assign sorted_number_ordered_pages = number_ordered_pages | sort:"nav_order" -%}
{%- assign sorted_number_ordered_pages = number_ordered_pages | sort:"nav_order" -%}
{%- comment -%}
{%- comment -%}
The string_ordered_pages have to be sorted by nav_order, and otherwise title.
The string_ordered_pages have to be sorted by nav_order, and otherwise title
(where appending the empty string to a numeric title converts it to a string).
After grouping them by those values, the groups are sorted, then the items
After grouping them by those values, the groups are sorted, then the items
of each group are concatenated.
of each group are concatenated.
{%- endcomment -%}
{%- endcomment -%}
{%- assign string_ordered_groups = string_ordered_pages
{%- assign string_ordered_groups = string_ordered_pages
| group_by_exp:"item", "item.nav_order | default: item.title |
string
" -%}
| group_by_exp:"item", "item.nav_order | default: item.title |
append:''
" -%}
{%- if site.nav_sort == 'case_insensitive' -%}
{%- if site.nav_sort == 'case_insensitive' -%}
{%- assign sorted_string_ordered_groups = string_ordered_groups | sort_natural:"name" -%}
{%- assign sorted_string_ordered_groups = string_ordered_groups | sort_natural:"name" -%}
{%- else -%}
{%- else -%}
...
...
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