Skip to content

Commit f6bf024

Browse files
Fixing csp errors (#141)
* Fix site URL and baseurl for custom domain * Adding filter to remove URL redirect pages from appearing in the side nav * Fixing CSP errors * Commenting out unecessary JS * Small CSS tweak to add padding to section headings in the side nav * Implementing correct heading captions as per NHS design system --------- Co-authored-by: emmagifford <[email protected]>
1 parent 4dd1d63 commit f6bf024

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

docs/_includes/components/phase-banner.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515

1616
</div>
1717
</div>
18+
<!--
1819
<script>
1920
console.log("{{include.auto_hide}}")
2021
if ("{{include.auto_hide}}" == 'true' && (window.location.hostname.startsWith('notify.nhs.uk') || window.location.hostname.startsWith('127.0.0.2'))) {
2122
document.getElementById("{{ include.phase_id }}").style.visibility = 'hidden';
2223
}
2324
</script>
25+
-->

docs/_layouts/default.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
</head>
2525

2626
<body class="wrap">
27-
<script>document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' nhsuk-frontend-supported' : '');</script>
28-
2927
<a class="nhsuk-skip-link" href="#maincontent">Skip to main content</a>
3028

3129
{%- include header.html -%}
@@ -34,10 +32,7 @@
3432

3533
{%- include footer.html -%}
3634

37-
<script type="module">
38-
import { initAll } from '{{site.baseurl}}/assets/js/nhsuk-frontend.min.js'
39-
initAll()
40-
</script>
35+
<script type="module" src="{{site.baseurl}}/assets/js/init.js"></script>
4136
</body>
4237

4338
</html>

docs/_layouts/page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@
121121
</div>
122122
<div class="nhsnotify-pane__main-content">
123123
{% if page.section != undefined %}
124-
<heading class="nhsuk-heading-s" style="margin-bottom: 0; color: #4c6272">{{ page.section }}</heading>
124+
<span class="nhsuk-caption-xl">{{ page.section }}</span>
125125
{% endif %}
126-
<h1>{{ page.title }}</h1>
126+
<h1 class="nhsuk-heading-xl">{{ page.title }}</h1>
127127
{{ content }}
128128
</div>
129129
</div>

docs/assets/css/_nhsnotify-side-nav.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
}
6262
}
6363

64+
.nhsnotify-side-nav__list-section:not(:first-of-type) {
65+
margin-top: 24px;
66+
}
67+
6468
.nhsnotify-side-nav__item {
6569
padding: 4px 0 0.5em;
6670

docs/assets/js/init.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Add classes to body for progressive enhancement
2+
document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' nhsuk-frontend-supported' : '');
3+
4+
// Initialize NHS UK Frontend components
5+
import { initAll } from './nhsuk-frontend.min.js';
6+
initAll();

0 commit comments

Comments
 (0)