Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
docs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
docs
Commits
ccc3d974
Commit
ccc3d974
authored
Jan 19, 2016
by
Tobias Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename navigation helper function to nav()
parent
ba144dbb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
docs.html
layouts/docs.html
+1
-1
nav.rb
lib/helpers/nav.rb
+2
-2
No files found.
layouts/docs.html
View file @
ccc3d974
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<div
class=
"col-md-3 side-nav-col"
>
<div
class=
"col-md-3 side-nav-col"
>
<ul
class=
"nav navbar-nav side-nav"
>
<ul
class=
"nav navbar-nav side-nav"
>
<
%
@
items
['/
docs
/'].
children
.
sort_by
{
|
i
|
i
[
:sort_rank
]
||
0
}.
each
do
|
i
|
%
>
<
%
@
items
['/
docs
/'].
children
.
sort_by
{
|
i
|
i
[
:sort_rank
]
||
0
}.
each
do
|
i
|
%
>
<
%=
toc
(
i
,
@
item
)
%
>
<
%=
nav
(
i
,
@
item
)
%
>
<
%
end
%
>
<
%
end
%
>
</ul>
</ul>
</div>
</div>
...
...
lib/helpers/
toc
.rb
→
lib/helpers/
nav
.rb
View file @
ccc3d974
...
@@ -2,7 +2,7 @@ def nav_title_of(i)
...
@@ -2,7 +2,7 @@ def nav_title_of(i)
i
[
:nav_title
]
||
i
[
:title
]
||
''
i
[
:nav_title
]
||
i
[
:title
]
||
''
end
end
def
toc
(
root_item
,
focused_item
,
buffer
=
''
,
layer
=
0
)
def
nav
(
root_item
,
focused_item
,
buffer
=
''
,
layer
=
0
)
# Skip non-written or hidden items
# Skip non-written or hidden items
return
buffer
if
root_item
.
nil?
||
root_item
.
path
.
nil?
||
root_item
[
:is_hidden
]
return
buffer
if
root_item
.
nil?
||
root_item
.
path
.
nil?
||
root_item
[
:is_hidden
]
...
@@ -30,7 +30,7 @@ def toc(root_item, focused_item, buffer='', layer=0)
...
@@ -30,7 +30,7 @@ def toc(root_item, focused_item, buffer='', layer=0)
buffer
<<
'<ul class="nav">'
buffer
<<
'<ul class="nav">'
visible_children
.
each
do
|
child
|
visible_children
.
each
do
|
child
|
toc
(
child
,
focused_item
,
buffer
,
layer
+
1
)
nav
(
child
,
focused_item
,
buffer
,
layer
+
1
)
end
end
buffer
<<
'</ul>'
buffer
<<
'</ul>'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment