-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpage.html
More file actions
91 lines (83 loc) · 2.92 KB
/
page.html
File metadata and controls
91 lines (83 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
layout: default
---
{% assign current_dir = page.dir %}
{% assign paths = page.dir | split: "/" %}
{% assign parent_dir = paths[1] %}
{%-
assign nav_pages = site.pages
| where_exp: "item", "item.dir contains parent_dir"
-%}
{% assign first_level_dir = parent_dir | prepend: '/' | append: '/' %}
{%-
assign first_level = nav_pages
| where_exp: "item", "item.dir == first_level_dir"
| group_by: "section"
-%}
{%- assign section_order = site.data.sidebar-section-order.sections -%}
{%- assign ordered_sections = "" | split: "" -%}
{%- for section_name in section_order -%}
{%- for section in first_level -%}
{%- if section.name == section_name -%}
{%- assign ordered_sections = ordered_sections | push: section -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}
{%- comment -%}
Add any sections not in the manual order list at the end
{%- endcomment -%}
{%- for section in first_level -%}
{%- assign found = false -%}
{%- for ordered_section in ordered_sections -%}
{%- if section.name == ordered_section.name -%}
{%- assign found = true -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}
{%- unless found -%}
{%- assign ordered_sections = ordered_sections | push: section -%}
{%- endunless -%}
{%- endfor -%}
<div class="nhsuk-width-container">
{%- include breadcrumb.html -%}
<main class="nhsuk-main-wrapper--s" id="maincontent" role="main">
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-full">
<div class="nhsnotify-pane">
<div class="nhsnotify-pane__side-bar">
<nav class="nhsnotify-side-nav">
<ul class="nhsuk-list nhsnotify-side-nav__list">
{% for section in ordered_sections %}
{% if section.name != "" %}
<li class="nhsuk-u-font-weight-bold nhsnotify-side-nav__list-section">{{ section.name }}</li>
{% endif %}
{% assign sorted = section.items | sort: 'nav_order' %}
{% for post in sorted %}
{% unless post.has_children %}
<li class="
nhsnotify-side-nav__item
{% if post.url == page.url %}
nhsnotify-side-nav__item--current
{% endif %}
">
<a class="nhsnotify-side-nav__link" href="{{ site.baseurl | append: post.url }}">{{ post.title }}</a>
</li>
{% endunless %}
{% endfor %}
{% endfor %}
</ul>
</nav>
</div>
<div class="nhsnotify-pane__main-content">
{% if page.section != undefined %}
<heading class="nhsuk-heading-s" style="margin-bottom: 0; color: #4c6272">{{ page.section }}</heading>
{% endif %}
<h1>{{ page.title }}</h1>
{{ content }}
</div>
</div>
</div>
</div>
</main>
</div>