Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mkdocs-material
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
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Janne Mareike Koschinski
mkdocs-material
Commits
610d8c0e
Commit
610d8c0e
authored
9 years ago
by
squidfunk
Browse files
Options
Downloads
Patches
Plain Diff
Fixed #5: Page without headlines renders empty list in table of contents
parent
ba72ddb9
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG
+1
-0
1 addition, 0 deletions
CHANGELOG
material/nav.html
+15
-19
15 additions, 19 deletions
material/nav.html
src/nav.html
+23
-29
23 additions, 29 deletions
src/nav.html
with
39 additions
and
48 deletions
CHANGELOG
+
1
−
0
View file @
610d8c0e
...
...
@@ -2,6 +2,7 @@ mkdocs-material-0.x.x (2016-xx-xx)
* Fixed #3: Ordered lists within an unordered list have ::before content
* Fixed #4: Click on Logo/Title without Github-Repository: "None"
* Fixed #5: Page without headlines renders empty list in table of contents
* Moved Modernizr to top to ensure basic usability in IE8
mkdocs-material-0.1.2 (2016-02-16)
...
...
This diff is collapsed.
Click to expand it.
material/nav.html
+
15
−
19
View file @
610d8c0e
...
...
@@ -13,25 +13,21 @@
{{ nav_item.title }}
</a>
{% if nav_item == current_page %}
{% if h1 %}
{% set toc_item = toc | first %}
{% set toc = toc_item.children %}
{% endif %}
{% if toc %}
<ul>
{% for toc_item in toc %}
{% if h1 %}
{% for toc_item in toc_item.children %}
<li
class=
"anchor"
>
<a
title=
"{{ toc_item.title }}"
href=
"{{ toc_item.url }}"
>
{{ toc_item.title }}
</a>
</li>
{% endfor %}
{% else %}
<li
class=
"anchor"
>
<a
title=
"{{ toc_item.title }}"
href=
"{{ toc_item.url }}"
>
{{ toc_item.title }}
</a>
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% endif %}
</li>
{% endif %}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/nav.html
+
23
−
29
View file @
610d8c0e
...
...
@@ -21,28 +21,22 @@
<!-- Expand active pages -->
{% if nav_item == current_page %}
<ul>
<!-- Render anchors of active page -->
{% for toc_item in toc %}
<!--
The top-level anchor must be skipped if the article contains a h1
headline, since it would be redundant to the link to the current
page
that is located just above the anchor. Therefore we directly
continue
with the children of the anchor.
headline, since it would be redundant to the link to the current
page
that is located just above the anchor. Therefore we directly
continue
with the children of the anchor.
-->
{% if h1 %}
{% for toc_item in toc_item.children %}
{% set toc_item = toc | first %}
{% set toc = toc_item.children %}
{% endif %}
<!-- Render anchor -->
<li
class=
"anchor"
>
<a
title=
"{{ toc_item.title }}"
href=
"{{ toc_item.url }}"
>
{{ toc_item.title }}
</a>
</li>
{% endfor %}
{% else %}
<!-- Render anchors of active page -->
{% if toc %}
<ul>
{% for toc_item in toc %}
<!-- Render anchor -->
<li
class=
"anchor"
>
...
...
@@ -50,9 +44,9 @@
{{ toc_item.title }}
</a>
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% endif %}
</li>
{% endif %}
\ 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