|
1 | 1 | --- |
2 | 2 | layout: default |
3 | 3 | --- |
| 4 | + |
| 5 | +{% assign current_dir = page.dir %} |
| 6 | +{% assign paths = page.dir | split: "/" %} |
| 7 | +{% assign parent_dir = paths[1] %} |
| 8 | + |
| 9 | +{%- |
| 10 | + assign nav_pages = site.pages |
| 11 | + | where_exp: "item", "item.dir contains parent_dir" |
| 12 | +-%} |
| 13 | + |
| 14 | +{% assign first_level_dir = parent_dir | prepend: '/' | append: '/' %} |
| 15 | +{%- |
| 16 | + assign first_level = nav_pages |
| 17 | + | where_exp: "item", "item.dir == first_level_dir" |
| 18 | + | group_by: "section" |
| 19 | + | sort: 'name', 'last' |
| 20 | +-%} |
4 | 21 | <div class="nhsuk-width-container"> |
5 | 22 | <main class="nhsuk-main-wrapper" id="maincontent" role="main"> |
6 | | - <h1>{{ page.title }}</h1> |
7 | | - {{ content }} |
| 23 | + <div class="nhsuk-grid-row"> |
| 24 | + <div class="nhsuk-grid-column-full"> |
| 25 | + <div class="nhsnotify-pane"> |
| 26 | + <div class="nhsnotify-pane__side-bar nhsuk-grid-column-one-quarter"> |
| 27 | + <nav class="nhsnotify-side-nav"> |
| 28 | + <ul class="nhsuk-list nhsnotify-side-nav__list"> |
| 29 | + {% for section in first_level %} |
| 30 | + {% if section.name != "" %} |
| 31 | + <p class="nhsuk-u-font-weight-bold nhsnotify-side-nav__list-section">{{ section.name }}</p> |
| 32 | + {% endif %} |
| 33 | + {% assign sorted = section.items | sort: 'nav_order' %} |
| 34 | + {% for post in sorted %} |
| 35 | + <li class=" |
| 36 | + nhsnotify-side-nav__item |
| 37 | + {% if post.url == page.url %} |
| 38 | + nhsnotify-side-nav__item--current |
| 39 | + {% endif %} |
| 40 | + "> |
| 41 | + <a class="nhsnotify-side-nav__link" href="{{ site.baseurl | append: post.url }}">{{ post.title }}</a> |
| 42 | + </li> |
| 43 | + {% endfor %} |
| 44 | + {% endfor %} |
| 45 | + </ul> |
| 46 | + |
| 47 | + </nav> |
| 48 | + </div> |
| 49 | + <div class="nhsnotify-pane__main-content nhsuk-grid-column-three-quarters"> |
| 50 | + {% if page.section != "" %} |
| 51 | + <h5 style="margin-bottom: 0; color: #4c6272">{{ page.section }}</h5> |
| 52 | + {% endif %} |
| 53 | + <h1>{{ page.title }}</h1> |
| 54 | + {{ content }} |
| 55 | + </div> |
| 56 | + </div> |
| 57 | + </div> |
| 58 | + </div> |
8 | 59 | </main> |
9 | 60 | </div> |
0 commit comments