Skip to content

Commit cf75252

Browse files
committed
Fix nav issue at root
1 parent 7f48566 commit cf75252

File tree

2 files changed

+38
-38
lines changed

2 files changed

+38
-38
lines changed

sass/_post.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ h5.description {
1010
div.post-meta {
1111
display: flex;
1212
flex-direction: column;
13-
justify-content: space-between;
13+
justify-content: space-evenly;
1414
font-family: var(--font-heading) !important;
1515
padding-top: var(--font-size-text);
1616
padding-bottom: var(--font-size-text);

templates/macros/navigation.html

+37-37
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,44 @@
22
<nav id="tree">
33
{# Walk 'Up' the ancestor path to show the page-tree #}
44
{%- for ancestor_path in page_or_section.ancestors | default(value=[]) -%}
5-
<ul>
6-
{# Each ancestor will have an index (linked in the next loop as that ancestor link), pages, and sections #}
7-
{%- set ancestor = get_section(path=ancestor_path) -%}
8-
{# We do pages first as they are the 'main content' for an ancestor, sections tend to be 'Sub-ideas' #}
9-
{%- for ancestor_page in ancestor.pages | default(value=[]) -%}
10-
{%- set is_descendant = page_or_section.ancestors is containing(ancestor_page.relative_path) -%}
11-
{%- set is_current = page_or_section == ancestor_page -%}
12-
{%- if ancestor_page.extra.in_menu | default(value=false) or is_descendant -%}
13-
<li>
14-
<a
15-
{% if is_descendant -%} class="ancestor" {%- endif %}
16-
{% if is_current -%} class="current" {%- endif %}
17-
href="{{ ancestor_page.permalink | safe }}"
18-
>
19-
{{ ancestor_page.title | markdown(inline=true) }}
20-
</a>&nbsp;
21-
</li>
22-
{%- endif -%}
23-
{%- endfor -%}
5+
<ul>
6+
{# Each ancestor will have an index (linked in the next loop as that ancestor link), pages, and sections #}
7+
{%- set ancestor = get_section(path=ancestor_path) -%}
8+
{# We do pages first as they are the 'main content' for an ancestor, sections tend to be 'Sub-ideas' #}
9+
{%- for ancestor_page in ancestor.pages | default(value=[]) -%}
10+
{%- set is_descendant = page_or_section.ancestors is containing(ancestor_page.relative_path) -%}
11+
{%- set is_current = page_or_section == ancestor_page -%}
12+
{%- if ancestor_page.extra.in_menu | default(value=false) or is_descendant -%}
13+
<li>
14+
<a
15+
{% if is_descendant -%} class="ancestor" {%- endif %}
16+
{% if is_current -%} class="current" {%- endif %}
17+
href="{{ ancestor_page.permalink | safe }}"
18+
>
19+
{{ ancestor_page.title | markdown(inline=true) }}
20+
</a>&nbsp;
21+
</li>
22+
{%- endif -%}
23+
{%- endfor -%}
2424

25-
{# Now sections, the 'Sub-ideas' -- these may have their own descendants #}
26-
{%- for ancestor_section_path in ancestor.subsections -%}
27-
{%- set ancestor_section = get_section(path=ancestor_section_path) -%}
28-
{%- set is_descendant = page_or_section.ancestors is containing(ancestor_section.relative_path) -%}
29-
{%- set is_current = page_or_section == ancestor_section -%}
30-
{%- if ancestor_section.extra.in_menu | default(value=false) or is_descendant -%}
31-
<li>
32-
<a
33-
{% if is_descendant -%} class="ancestor" {%- endif %}
34-
{% if is_current -%} class="current" {%- endif %}
35-
href="{{ ancestor_section.permalink | safe }}"
36-
>
37-
{{ ancestor_section.title | markdown(inline=true) }}
38-
</a>&nbsp;
39-
</li>
40-
{%- endif -%}
41-
{%- endfor -%}
42-
</ul>
25+
{# Now sections, the 'Sub-ideas' -- these may have their own descendants #}
26+
{%- for ancestor_section_path in ancestor.subsections -%}
27+
{%- set ancestor_section = get_section(path=ancestor_section_path) -%}
28+
{%- set is_descendant = page_or_section.ancestors is containing(ancestor_section.relative_path) -%}
29+
{%- set is_current = page_or_section == ancestor_section -%}
30+
{%- if ancestor_section.extra.in_menu | default(value=false) or is_descendant or is_current -%}
31+
<li>
32+
<a
33+
{% if is_descendant -%} class="ancestor" {%- endif %}
34+
{% if is_current -%} class="current" {%- endif %}
35+
href="{{ ancestor_section.permalink | safe }}"
36+
>
37+
{{ ancestor_section.title | markdown(inline=true) }}
38+
</a>&nbsp;
39+
</li>
40+
{%- endif -%}
41+
{%- endfor -%}
42+
</ul>
4343
{%- endfor -%}
4444
<ul>
4545
{# Next, we show the line for the 'current' items pages (the 'main content'), then sections (the 'Sub-ideas') #}

0 commit comments

Comments
 (0)