Add sections to docs #3
This commit is contained in:
parent
0cd6f76e8c
commit
6c9da90f7a
@ -3,4 +3,9 @@ title = "Docs"
|
|||||||
sort_by = "weight"
|
sort_by = "weight"
|
||||||
template = "docs.html"
|
template = "docs.html"
|
||||||
page_template = "documentation_page.html"
|
page_template = "documentation_page.html"
|
||||||
|
|
||||||
|
[extra]
|
||||||
|
sections = [
|
||||||
|
"More"
|
||||||
|
]
|
||||||
+++
|
+++
|
||||||
|
|||||||
8
content/docs/details/index.md
Normal file
8
content/docs/details/index.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
+++
|
||||||
|
weight = 2
|
||||||
|
title = "Details"
|
||||||
|
[extra]
|
||||||
|
section = 1
|
||||||
|
+++
|
||||||
|
|
||||||
|
This is overview's content!
|
||||||
@ -1,6 +1,8 @@
|
|||||||
+++
|
+++
|
||||||
weight = 1
|
weight = 0
|
||||||
title = "Overview"
|
title = "Overview"
|
||||||
|
[extra]
|
||||||
|
section = 0
|
||||||
+++
|
+++
|
||||||
|
|
||||||
This is overview's content!
|
This is overview's content!
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
+++
|
+++
|
||||||
weight = 1
|
weight = 1
|
||||||
title = "Page 2"
|
title = "Page 2"
|
||||||
|
[extra]
|
||||||
|
section = 1
|
||||||
+++
|
+++
|
||||||
|
|
||||||
Another page
|
Another page
|
||||||
|
|||||||
@ -1,7 +1,20 @@
|
|||||||
<div id="docs">
|
<div id="docs">
|
||||||
{%- for page in section.pages %}
|
{%- for page in section.pages %}
|
||||||
<li>
|
{%- if page.extra.section == 0 %}
|
||||||
<a href="{{ page.permalink | safe }}">{{ page.title }}</a>
|
<li>
|
||||||
</li>
|
<a href="{{ page.permalink | safe }}">{{ page.title }}</a>
|
||||||
|
</li>
|
||||||
|
{%- endif %}
|
||||||
|
{%- endfor %}
|
||||||
|
{%- for page_section, pages in section.pages | group_by(attribute="extra.section") %}
|
||||||
|
{% set int_section = page_section | int %}
|
||||||
|
{%- if int_section > 0 %}
|
||||||
|
<h3>{{ section.extra.sections | nth(n=int_section - 1) }}</h3>
|
||||||
|
{%- for page in pages %}
|
||||||
|
<li>
|
||||||
|
<a href="{{ page.permalink | safe }}">{{ page.title }}</a>
|
||||||
|
</li>
|
||||||
|
{%- endfor %}
|
||||||
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user