diff --git a/lib/generate-npm-package.js b/lib/generate-npm-package.js
index 95b1eaec48..e8c53d7ffb 100644
--- a/lib/generate-npm-package.js
+++ b/lib/generate-npm-package.js
@@ -46,7 +46,9 @@ async function copyComponent(componentName) {
const componentPath = `${componentsPath}/${componentName}`;
const newComponentPath = `${newComponentsPath}/${componentName}`;
- const items = await fs.readdirSync(componentPath).filter(path => path.includes('.njk') && path.includes('_'));
+ const items = await fs
+ .readdirSync(componentPath)
+ .filter(path => path.includes('.njk') && path.includes('_') && !path.includes('_test-'));
if (items.length) {
await createFolder(newComponentPath);
diff --git a/lib/helpers/generate-example-params.js b/lib/helpers/generate-example-params.js
index e4e1299fee..ac38b3419c 100644
--- a/lib/helpers/generate-example-params.js
+++ b/lib/helpers/generate-example-params.js
@@ -20,7 +20,7 @@ export function generateExampleParams(params, addDependency) {
const srcPath = params.componentFolderPath ? `${sourcePath}/${params.componentFolderPath}/` : `${path.split('/examples/')[0]}/`;
const optionsPath = `${srcPath}_macro-options.md`;
- const templatePath = `${srcPath}_template.njk`;
+ const macroPath = `${srcPath}_macro.njk`;
let options;
let scss;
@@ -48,9 +48,9 @@ export function generateExampleParams(params, addDependency) {
scss = sassRaw.join('\n');
}
- if (fs.existsSync(templatePath)) {
- addDependency(templatePath);
- template = `{% raw %}${fs.readFileSync(templatePath, 'utf8')}{% endraw %}`;
+ if (fs.existsSync(macroPath)) {
+ addDependency(macroPath);
+ template = `{% raw %}${fs.readFileSync(macroPath, 'utf8')}{% endraw %}`;
}
const loader = new NunjucksLoader(sourcePath);
diff --git a/src/components/accordion/_macro.njk b/src/components/accordion/_macro.njk
index 2e3f677aab..5c51e56922 100644
--- a/src/components/accordion/_macro.njk
+++ b/src/components/accordion/_macro.njk
@@ -1,3 +1,36 @@
{% macro onsAccordion(params) %}
- {% include "components/accordion/_template.njk" %}
+ {% from "components/details/_macro.njk" import onsDetails %}
+
+
+ {% if params.openAll and params.closeAll %}
+ {% from "components/button/_macro.njk" import onsButton %}
+ {{
+ onsButton({
+ "text": params.openAll,
+ "classes": "btn--secondary btn--small js-collapsible-all u-wa--@xs u-mb-s u-d-no",
+ "attributes": {
+ "data-ga": "click",
+ "data-ga-category": "accordion",
+ "data-ga-action": "Toggle all panels",
+ "data-ga-label": params.openAll,
+ "data-close-all": params.closeAll,
+ "data-group": params.id
+ }
+ })
+ }}
+ {% endif %}
+ {% for item in params.items %}
+ {{
+ onsDetails({
+ "isAccordion": true,
+ "id": params.id + "-" + loop.index,
+ "buttonOpen": params.buttonOpen,
+ "closeButton": params.closeButton,
+ "title": item.title,
+ "content": item.content,
+ "group": params.id
+ })
+ }}
+ {% endfor %}
+
{% endmacro %}
diff --git a/src/components/accordion/_template.njk b/src/components/accordion/_template.njk
deleted file mode 100644
index 62b466822b..0000000000
--- a/src/components/accordion/_template.njk
+++ /dev/null
@@ -1,34 +0,0 @@
-{% from "components/details/_macro.njk" import onsDetails %}
-
-
- {% if params.openAll and params.closeAll %}
- {% from "components/button/_macro.njk" import onsButton %}
- {{
- onsButton({
- "text": params.openAll,
- "classes": "btn--secondary btn--small js-collapsible-all u-wa--@xs u-mb-s u-d-no",
- "attributes": {
- "data-ga": "click",
- "data-ga-category": "accordion",
- "data-ga-action": "Toggle all panels",
- "data-ga-label": params.openAll,
- "data-close-all": params.closeAll,
- "data-group": params.id
- }
- })
- }}
- {% endif %}
- {% for item in params.items %}
- {{
- onsDetails({
- "isAccordion": true,
- "id": params.id + "-" + loop.index,
- "buttonOpen": params.buttonOpen,
- "closeButton": params.closeButton,
- "title": item.title,
- "content": item.content,
- "group": params.id
- })
- }}
- {% endfor %}
-
diff --git a/src/components/accordion/_test-template.njk b/src/components/accordion/_test-template.njk
new file mode 100644
index 0000000000..d4fafcedd5
--- /dev/null
+++ b/src/components/accordion/_test-template.njk
@@ -0,0 +1,3 @@
+{% from "components/accordion/_macro.njk" import onsAccordion %}
+
+{{ onsAccordion(params) }}
diff --git a/src/components/breadcrumb/_macro.njk b/src/components/breadcrumb/_macro.njk
index 96b7b1340d..172f71dc2b 100644
--- a/src/components/breadcrumb/_macro.njk
+++ b/src/components/breadcrumb/_macro.njk
@@ -1,3 +1,15 @@
{% macro onsBreadcrumb(params) %}
- {% include "components/breadcrumb/_template.njk" %}
+
+
+ {% for item in params.items %}
+
+ {% if item.current %}
+ {{ item.text }}
+ {% else %}
+ {{ item.text }}
+ {% endif %}
+
+ {% endfor %}
+
+
{% endmacro %}
diff --git a/src/components/breadcrumb/_template.njk b/src/components/breadcrumb/_template.njk
deleted file mode 100644
index a03a3a7245..0000000000
--- a/src/components/breadcrumb/_template.njk
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
- {% for item in params.items %}
-
- {% if item.current %}
- {{ item.text }}
- {% else %}
- {{ item.text }}
- {% endif %}
-
- {% endfor %}
-
-
diff --git a/src/components/button/_macro.njk b/src/components/button/_macro.njk
index 21ced08afb..95e7618d25 100644
--- a/src/components/button/_macro.njk
+++ b/src/components/button/_macro.njk
@@ -1,3 +1,17 @@
{% macro onsButton(params) %}
- {% include "components/button/_template.njk" %}
+ {#- Define common attributes we can use for the toggle button type #}
+ {% set buttonToggleAttributes %} aria-haspopup="true" aria-expanded="false" aria-controls="{{ params.ariaControls }}" aria-label="{{ params.ariaLabel }}"{% endset %}
+
+
+ {{- params.html | safe if params.html else params.text -}}
+
{% endmacro %}
diff --git a/src/components/button/_template.njk b/src/components/button/_template.njk
deleted file mode 100644
index 5bd993ecf6..0000000000
--- a/src/components/button/_template.njk
+++ /dev/null
@@ -1,16 +0,0 @@
-{#- Define common attributes we can use for the toggle button type #}
-{% set buttonToggleAttributes %} aria-haspopup="true" aria-expanded="false" aria-controls="{{ params.ariaControls }}" aria-label="{{ params.ariaLabel }}"{% endset %}
-
-
- {{- params.html | safe if params.html else params.text -}}
-
-
diff --git a/src/components/card/_macro.njk b/src/components/card/_macro.njk
index c53f19a5e5..3ac795f228 100644
--- a/src/components/card/_macro.njk
+++ b/src/components/card/_macro.njk
@@ -1,3 +1,14 @@
{%- macro onsCard(params) -%}
-{% include "components/card/_template.njk" %}
+
+
+ {% if params.url -%}
+
+ {{ params.title }}
+
+ {%- else %}
+ {{ params.title }}
+ {% endif %}
+
+
{{ params.text }}
+
{%- endmacro -%}
diff --git a/src/components/card/_template.njk b/src/components/card/_template.njk
deleted file mode 100644
index 263c39c1c3..0000000000
--- a/src/components/card/_template.njk
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
- {% if params.url -%}
-
- {{ params.title }}
-
- {%- else %}
- {{ params.title }}
- {% endif %}
-
-
{{ params.text }}
-
diff --git a/src/components/checkboxes/_macro.njk b/src/components/checkboxes/_macro.njk
index b0e45ccf3f..287fad99e9 100644
--- a/src/components/checkboxes/_macro.njk
+++ b/src/components/checkboxes/_macro.njk
@@ -1,3 +1,56 @@
{% macro onsCheckboxes(params) %}
- {% include "components/checkboxes/_template.njk" %}
+ {% from "components/field/_macro.njk" import onsField %}
+ {% from "components/checkboxes/_checkbox-macro.njk" import onsCheckbox %}
+
+ {% call onsField({
+ "id": params.id,
+ "legend": params.legend,
+ "description": params.description,
+ "classes": params.classes,
+ "mutuallyExclusive": params.mutuallyExclusive,
+ "legendClasses": params.legendClasses,
+ "questionMode": params.questionMode
+ }) %}
+ {{ params.checkboxesLabel }}
+
+ {% for checkbox in params.checkboxes %}
+ {% set labelHTML = checkbox.label.text %}
+ {% if params.mutuallyExclusive %}
+ {% set exclusiveClass = ' js-exclusive-group' %}
+ {% endif %}
+
+ {{
+ onsCheckbox({
+ "id": checkbox.id,
+ "name": checkbox.name,
+ "value": checkbox.value,
+ "checked": checkbox.checked,
+ "classes": checkbox.classes,
+ "inputClasses": exclusiveClass,
+ "label": {
+ "for": checkbox.id,
+ "text": labelHTML,
+ "description": checkbox.label.description,
+ "classes": checkbox.label.classes | default('')
+ },
+ "attributes": checkbox.attributes,
+ "other": {
+ "id": checkbox.other.id,
+ "name": checkbox.other.name,
+ "type": checkbox.other.type,
+ "classes": checkbox.other.classes | default('') + exclusiveClass | default(''),
+ "attributes": checkbox.other.attributes,
+ "label": {
+ "text": checkbox.other.label.text
+ }
+ }
+ })
+ }}
+
+ {% if not loop.last %}
+
+ {% endif %}
+ {% endfor %}
+
+ {% endcall %}
{% endmacro %}
diff --git a/src/components/checkboxes/_template.njk b/src/components/checkboxes/_template.njk
deleted file mode 100644
index 49ba6c4d83..0000000000
--- a/src/components/checkboxes/_template.njk
+++ /dev/null
@@ -1,54 +0,0 @@
-{% from "components/field/_macro.njk" import onsField %}
-{% from "components/checkboxes/_checkbox-macro.njk" import onsCheckbox %}
-
-{% call onsField({
- "id": params.id,
- "legend": params.legend,
- "description": params.description,
- "classes": params.classes,
- "mutuallyExclusive": params.mutuallyExclusive,
- "legendClasses": params.legendClasses,
- "questionMode": params.questionMode
-}) %}
- {{ params.checkboxesLabel }}
-
- {% for checkbox in params.checkboxes %}
- {% set labelHTML = checkbox.label.text %}
- {% if params.mutuallyExclusive %}
- {% set exclusiveClass = ' js-exclusive-group' %}
- {% endif %}
-
- {{
- onsCheckbox({
- "id": checkbox.id,
- "name": checkbox.name,
- "value": checkbox.value,
- "checked": checkbox.checked,
- "classes": checkbox.classes,
- "inputClasses": exclusiveClass,
- "label": {
- "for": checkbox.id,
- "text": labelHTML,
- "description": checkbox.label.description,
- "classes": checkbox.label.classes | default('')
- },
- "attributes": checkbox.attributes,
- "other": {
- "id": checkbox.other.id,
- "name": checkbox.other.name,
- "type": checkbox.other.type,
- "classes": checkbox.other.classes | default('') + exclusiveClass | default(''),
- "attributes": checkbox.other.attributes,
- "label": {
- "text": checkbox.other.label.text
- }
- }
- })
- }}
-
- {% if not loop.last %}
-
- {% endif %}
- {% endfor %}
-
-{% endcall %}
diff --git a/src/components/checkboxes/_test-template.njk b/src/components/checkboxes/_test-template.njk
new file mode 100644
index 0000000000..a36825d3eb
--- /dev/null
+++ b/src/components/checkboxes/_test-template.njk
@@ -0,0 +1,3 @@
+{% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
+
+{{ onsCheckboxes(params) }}
diff --git a/src/components/date-input/_macro.njk b/src/components/date-input/_macro.njk
index b0851e5859..f20f10e1fb 100644
--- a/src/components/date-input/_macro.njk
+++ b/src/components/date-input/_macro.njk
@@ -1,3 +1,80 @@
{% macro onsDateInput(params) %}
- {% include "components/date-input/_template.njk" %}
+ {% from "components/field/_macro.njk" import onsField %}
+ {% from "components/input/_macro.njk" import onsInput %}
+ {% from "components/checkboxes/_checkbox-macro.njk" import onsCheckbox %}
+
+ {% if params.mutuallyExclusive %}
+ {% set exclusiveClass = " js-exclusive-group" %}
+ {% endif %}
+
+ {% call onsField({
+ "id": params.id,
+ "legend": params.legend,
+ "description": params.description,
+ "classes": "field--date" + (" " + params.classes if params.classes),
+ "descriptionClasses": descriptionClasses | default(""),
+ "legendClasses": params.legendClasses,
+ "mutuallyExclusive": params.mutuallyExclusive,
+ "questionMode": params.questionMode
+ }) %}
+
+ {% if params.day %}
+
+ {{
+ onsInput({
+ "id": params.id + "-day",
+ "type": "number",
+ "name": params.day.name,
+ "classes": "input--w-2" + exclusiveClass | default(""),
+ "min": 1,
+ "max": 31,
+ "attributes": params.day.attributes,
+ "label": {
+ "text": params.day.label
+ },
+ "value": params.day.value
+ })
+ }}
+
+ {% endif %}
+ {% if params.month %}
+
+ {{
+ onsInput({
+ "id": params.id + "-month",
+ "type": "number",
+ "name": params.month.name,
+ "classes": "input--w-2" + exclusiveClass | default(""),
+ "min": 1,
+ "max": 12,
+ "attributes": params.month.attributes,
+ "label": {
+ "text": params.month.label
+ },
+ "value": params.month.value
+ })
+ }}
+
+ {% endif %}
+ {% if params.year %}
+
+ {{
+ onsInput({
+ "id": params.id + "-year",
+ "type": "number",
+ "name": params.year.name,
+ "classes": "input--w-4" + exclusiveClass | default(""),
+ "min": 1000,
+ "max": 3000,
+ "attributes": params.year.attributes,
+ "label": {
+ "text": params.year.label
+ },
+ "value": params.year.value
+ })
+ }}
+
+ {% endif %}
+
+ {% endcall %}
{% endmacro %}
diff --git a/src/components/date-input/_template.njk b/src/components/date-input/_template.njk
deleted file mode 100644
index f265199c5c..0000000000
--- a/src/components/date-input/_template.njk
+++ /dev/null
@@ -1,78 +0,0 @@
-{% from "components/field/_macro.njk" import onsField %}
-{% from "components/input/_macro.njk" import onsInput %}
-{% from "components/checkboxes/_checkbox-macro.njk" import onsCheckbox %}
-
-{% if params.mutuallyExclusive %}
- {% set exclusiveClass = " js-exclusive-group" %}
-{% endif %}
-
-{% call onsField({
- "id": params.id,
- "legend": params.legend,
- "description": params.description,
- "classes": "field--date" + (" " + params.classes if params.classes),
- "descriptionClasses": descriptionClasses | default(""),
- "legendClasses": params.legendClasses,
- "mutuallyExclusive": params.mutuallyExclusive,
- "questionMode": params.questionMode
-}) %}
-
- {% if params.day %}
-
- {{
- onsInput({
- "id": params.id + "-day",
- "type": "number",
- "name": params.day.name,
- "classes": "input--w-2" + exclusiveClass | default(""),
- "min": 1,
- "max": 31,
- "attributes": params.day.attributes,
- "label": {
- "text": params.day.label
- },
- "value": params.day.value
- })
- }}
-
- {% endif %}
- {% if params.month %}
-
- {{
- onsInput({
- "id": params.id + "-month",
- "type": "number",
- "name": params.month.name,
- "classes": "input--w-2" + exclusiveClass | default(""),
- "min": 1,
- "max": 12,
- "attributes": params.month.attributes,
- "label": {
- "text": params.month.label
- },
- "value": params.month.value
- })
- }}
-
- {% endif %}
- {% if params.year %}
-
- {{
- onsInput({
- "id": params.id + "-year",
- "type": "number",
- "name": params.year.name,
- "classes": "input--w-4" + exclusiveClass | default(""),
- "min": 1000,
- "max": 3000,
- "attributes": params.year.attributes,
- "label": {
- "text": params.year.label
- },
- "value": params.year.value
- })
- }}
-
- {% endif %}
-
-{% endcall %}
diff --git a/src/components/date-input/_test-template.njk b/src/components/date-input/_test-template.njk
new file mode 100644
index 0000000000..5f37fd7b5c
--- /dev/null
+++ b/src/components/date-input/_test-template.njk
@@ -0,0 +1,3 @@
+{% from "components/date-input/_macro.njk" import onsDateInput %}
+
+{{ onsDateInput(params) }}
diff --git a/src/components/details/_macro.njk b/src/components/details/_macro.njk
index 8281d76d4e..e4b513887e 100644
--- a/src/components/details/_macro.njk
+++ b/src/components/details/_macro.njk
@@ -1,3 +1,43 @@
{% macro onsDetails(params) %}
- {% include "components/details/_template.njk" %}
+ {% from "components/button/_macro.njk" import onsButton %}
+
+
+
+ {# Required to use display flex on Safari as it's not currently supported: https://bugs.webkit.org/show_bug.cgi?id=167111 #}
+
+
{{ params.title }}
+ {% if params.closeButton and params.buttonOpen and params.isAccordion %}
+ {{
+ onsButton({
+ "text": params.buttonOpen,
+ "classes": "details__btn btn--secondary btn--small js-collapsible-button u-d-no u-d-no@xs@s",
+ "attributes": {
+ "data-ga": "click",
+ "data-ga-category": "definition",
+ "data-ga-action": "Close panel",
+ "data-ga-label": params.title
+ }
+ })
+ }}
+ {% endif %}
+
+
+
+ {{ params.content | safe }}{{ caller() if caller }}
+ {% if params.closeButton and params.isAccordion != true %}
+ {{
+ onsButton({
+ "text": params.buttonOpen or params.closeButton,
+ "classes": "btn--small js-collapsible-button u-d-no " + (params.closeButtonClasses | default("btn--secondary")),
+ "attributes": {
+ "data-ga": "click",
+ "data-ga-category": "definition",
+ "data-ga-action": "Close panel",
+ "data-ga-label": params.title
+ }
+ })
+ }}
+ {% endif %}
+
+
{% endmacro %}
diff --git a/src/components/details/_template.njk b/src/components/details/_template.njk
deleted file mode 100644
index f446425c39..0000000000
--- a/src/components/details/_template.njk
+++ /dev/null
@@ -1,42 +0,0 @@
-
-{% from "components/button/_macro.njk" import onsButton %}
-
-
-
- {# Required to use display flex on Safari as it's not currently supported: https://bugs.webkit.org/show_bug.cgi?id=167111 #}
-
-
{{ params.title }}
- {% if params.closeButton and params.buttonOpen and params.isAccordion %}
- {{
- onsButton({
- "text": params.buttonOpen,
- "classes": "details__btn btn--secondary btn--small js-collapsible-button u-d-no u-d-no@xs@s",
- "attributes": {
- "data-ga": "click",
- "data-ga-category": "definition",
- "data-ga-action": "Close panel",
- "data-ga-label": params.title
- }
- })
- }}
- {% endif %}
-
-
-
- {{ params.content | safe }}{{ caller() if caller }}
- {% if params.closeButton and params.isAccordion != true %}
- {{
- onsButton({
- "text": params.buttonOpen or params.closeButton,
- "classes": "btn--small js-collapsible-button u-d-no " + (params.closeButtonClasses | default("btn--secondary")),
- "attributes": {
- "data-ga": "click",
- "data-ga-category": "definition",
- "data-ga-action": "Close panel",
- "data-ga-label": params.title
- }
- })
- }}
- {% endif %}
-
-
diff --git a/src/components/details/_test-template.njk b/src/components/details/_test-template.njk
new file mode 100644
index 0000000000..1cf6848974
--- /dev/null
+++ b/src/components/details/_test-template.njk
@@ -0,0 +1,3 @@
+{% from "components/details/_macro.njk" import onsDetails %}
+
+{{ onsDetails(params) }}
diff --git a/src/components/feedback/_macro.njk b/src/components/feedback/_macro.njk
index 3cc7ad566f..cfaa8cc126 100644
--- a/src/components/feedback/_macro.njk
+++ b/src/components/feedback/_macro.njk
@@ -1,3 +1,64 @@
{% macro onsFeedback(params) %}
- {% include "components/feedback/_template.njk" %}
+ {% from "components/details/_macro.njk" import onsDetails %}
+ {% from "components/textarea/_macro.njk" import onsTextarea %}
+ {% from "components/input/_macro.njk" import onsInput %}
+ {% from "components/field/_macro.njk" import onsField %}
+ {% from "components/button/_macro.njk" import onsButton %}
+
+ {% call onsDetails({
+ "id": params.id,
+ "classes": "js-feedback",
+ "title": params.title,
+ "closeButton": params.closeButton,
+ "closeButtonClasses": params.closeButtonClasses
+ })
+ %}
+
+ {% endcall %}
{% endmacro %}
diff --git a/src/components/feedback/_template.njk b/src/components/feedback/_template.njk
deleted file mode 100644
index e71ff95673..0000000000
--- a/src/components/feedback/_template.njk
+++ /dev/null
@@ -1,62 +0,0 @@
-{% from "components/details/_macro.njk" import onsDetails %}
-{% from "components/textarea/_macro.njk" import onsTextarea %}
-{% from "components/input/_macro.njk" import onsInput %}
-{% from "components/field/_macro.njk" import onsField %}
-{% from "components/button/_macro.njk" import onsButton %}
-
-{% call onsDetails({
- "id": params.id,
- "classes": "js-feedback",
- "title": params.title,
- "closeButton": params.closeButton,
- "closeButtonClasses": params.closeButtonClasses
- })
-%}
-
-{% endcall %}
diff --git a/src/components/feedback/_test-template.njk b/src/components/feedback/_test-template.njk
new file mode 100644
index 0000000000..e351f8f6ef
--- /dev/null
+++ b/src/components/feedback/_test-template.njk
@@ -0,0 +1,3 @@
+{% from "components/feedback/_macro.njk" import onsFeedback %}
+
+{{ onsFeedback(params) }}
diff --git a/src/components/field/_macro.njk b/src/components/field/_macro.njk
index 213a6aa2ec..15a4523684 100644
--- a/src/components/field/_macro.njk
+++ b/src/components/field/_macro.njk
@@ -1,3 +1,55 @@
{% macro onsField(params) %}
- {% include "components/field/_template.njk" %}
+ {% if params.mutuallyExclusive or params.legend %}
+ {% if params.questionMode %}
+ {% set legend = "" + params.legend + " " %}
+ {% set classes = "field--question" + (" " + params.classes if params.classes) %}
+ {% else %}
+ {% set legend = params.legend %}
+ {% set classes = params.classes %}
+ {% endif %}
+
+
+ {{ legend | safe }}
+ {% if params.description %}
+
+ {{ params.description }}
+ {% endif %}
+
+ {{ caller() }}
+ {% if params.mutuallyExclusive %}
+ {% from "components/checkboxes/_checkbox-macro.njk" import onsCheckbox %}
+
+
+
{{ params.mutuallyExclusive.or }}
+ {{
+ onsCheckbox({
+ "id": params.mutuallyExclusive.checkbox.id,
+ "name": params.mutuallyExclusive.checkbox.name,
+ "value": params.mutuallyExclusive.checkbox.value,
+ "classes": params.mutuallyExclusive.checkbox.classes,
+ "inputClasses": "js-exclusive-checkbox",
+ "label": {
+ "text": '
' + params.mutuallyExclusive.or + ', ' + params.mutuallyExclusive.checkbox.label.text
+ },
+ "attributes": {
+ "data-deselect-message": params.mutuallyExclusive.deselectMessage
+ }
+ })
+ }}
+
+
+ {% endif %}
+
+ {% else %}
+ {% if not params.noField %}
+
+ {% endif %}
+ {% if params.description %}
+
{{ params.description }}
+ {% endif %}
+ {{ caller() }}
+ {% if not params.noField %}
+
+ {% endif %}
+ {% endif %}
{% endmacro %}
diff --git a/src/components/field/_template.njk b/src/components/field/_template.njk
deleted file mode 100644
index 19687a6505..0000000000
--- a/src/components/field/_template.njk
+++ /dev/null
@@ -1,53 +0,0 @@
-{% if params.mutuallyExclusive or params.legend %}
- {% if params.questionMode %}
- {% set legend = "" + params.legend + " " %}
- {% set classes = "field--question" + (" " + params.classes if params.classes) %}
- {% else %}
- {% set legend = params.legend %}
- {% set classes = params.classes %}
- {% endif %}
-
-
- {{ legend | safe }}
- {% if params.description %}
-
- {{ params.description }}
- {% endif %}
-
- {{ caller() }}
- {% if params.mutuallyExclusive %}
- {% from "components/checkboxes/_checkbox-macro.njk" import onsCheckbox %}
-
-
-
{{ params.mutuallyExclusive.or }}
- {{
- onsCheckbox({
- "id": params.mutuallyExclusive.checkbox.id,
- "name": params.mutuallyExclusive.checkbox.name,
- "value": params.mutuallyExclusive.checkbox.value,
- "classes": params.mutuallyExclusive.checkbox.classes,
- "inputClasses": "js-exclusive-checkbox",
- "label": {
- "text": '
' + params.mutuallyExclusive.or + ', ' + params.mutuallyExclusive.checkbox.label.text
- },
- "attributes": {
- "data-deselect-message": params.mutuallyExclusive.deselectMessage
- }
- })
- }}
-
-
- {% endif %}
-
-{% else %}
- {% if not params.noField %}
-
- {% endif %}
- {% if params.description %}
-
{{ params.description }}
- {% endif %}
- {{ caller() }}
- {% if not params.noField %}
-
- {% endif %}
-{% endif %}
diff --git a/src/components/footer/_macro.njk b/src/components/footer/_macro.njk
index ced9eabad9..68b0500245 100644
--- a/src/components/footer/_macro.njk
+++ b/src/components/footer/_macro.njk
@@ -1,3 +1,130 @@
{% macro onsFooter(params) %}
- {% include "components/footer/_template.njk" %}
+ {% from "components/lists/_macro.njk" import onsList %}
+
+ {% if params.lang %}
+ {% set lang = params.lang %}
+ {% else %}
+ {% set lang = 'en-GB' %}
+ {% endif %}
+
+ {% if params.poweredByONS %}
+ {% if params.poweredByONS.alt %}
+ {% set poweredByAlt = params.poweredByONS.alt %}
+ {% else %}
+ {% set poweredByAlt = 'Office for National Statistics' %}
+ {% endif %}
+ {% endif %}
+
+
{% endmacro %}
diff --git a/src/components/footer/_template.njk b/src/components/footer/_template.njk
deleted file mode 100644
index 152bffba50..0000000000
--- a/src/components/footer/_template.njk
+++ /dev/null
@@ -1,128 +0,0 @@
-{% from "components/lists/_macro.njk" import onsList %}
-
-{% if params.lang %}
- {% set lang = params.lang %}
-{% else %}
- {% set lang = 'en-GB' %}
-{% endif %}
-
-{% if params.poweredByONS %}
- {% if params.poweredByONS.alt %}
- {% set poweredByAlt = params.poweredByONS.alt %}
- {% else %}
- {% set poweredByAlt = 'Office for National Statistics' %}
- {% endif %}
-{% endif %}
-
-
diff --git a/src/components/header/_macro.njk b/src/components/header/_macro.njk
index 3aef39e4a5..0f4f5688ab 100644
--- a/src/components/header/_macro.njk
+++ b/src/components/header/_macro.njk
@@ -1,3 +1,95 @@
{% macro onsHeader(params) %}
- {% include "components/header/_template.njk" %}
+ {% from "components/button/_macro.njk" import onsButton %}
+
+
{% endmacro %}
diff --git a/src/components/header/_template.njk b/src/components/header/_template.njk
deleted file mode 100644
index f6a8bc82c0..0000000000
--- a/src/components/header/_template.njk
+++ /dev/null
@@ -1,93 +0,0 @@
-{% from "components/button/_macro.njk" import onsButton %}
-
-
diff --git a/src/components/header/_test-template.njk b/src/components/header/_test-template.njk
new file mode 100644
index 0000000000..114644327e
--- /dev/null
+++ b/src/components/header/_test-template.njk
@@ -0,0 +1,3 @@
+{% from "components/header/_macro.njk" import onsHeader %}
+
+{{ onsHeader(params) }}
diff --git a/src/components/input/_macro.njk b/src/components/input/_macro.njk
index 59e7e6f38f..ea8b5411af 100644
--- a/src/components/input/_macro.njk
+++ b/src/components/input/_macro.njk
@@ -1,3 +1,69 @@
{% macro onsInput(params) %}
- {% include "components/input/_template.njk" %}
+ {% from "components/field/_macro.njk" import onsField %}
+ {% from "components/label/_macro.njk" import onsLabel %}
+
+ {% if params.type == "number" %}
+ {# Type must be "text" or Firefox and Safari will set a blank value to the server if non numeric characters are entered -
+ they don't block non numeric characters: https://bugzilla.mozilla.org/show_bug.cgi?id=1398528 #}
+ {% set type = "text" %}
+ {% set pattern = "[0-9]*" %}
+ {% set inputmode = "numeric" %}
+ {% elif params.type %}
+ {% set type = params.type %}
+ {% else %}
+ {% set type = "text" %}
+ {% endif %}
+
+ {% set exclusiveClass = " js-exclusive-group" if params.mutuallyExclusive else "" %}
+
+ {% call onsField({
+ "id": params.fieldId,
+ "classes": params.fieldClasses,
+ "legendClasses": params.legendClasses,
+ "noField": params.noField,
+ "legend": params.label.text if params.mutuallyExclusive,
+ "description": params.label.description if params.mutuallyExclusive,
+ "mutuallyExclusive": params.mutuallyExclusive,
+ "questionMode": params.questionMode
+ }) %}
+ {% if params.label and not params.mutuallyExclusive %}
+ {{
+ onsLabel({
+ "for": params.id,
+ "id": params.label.id,
+ "text": params.label.text,
+ "classes": params.label.classes,
+ "description": params.label.description
+ })
+ }}
+ {% endif %}
+
+ {% if params.prefix !== undefined or params.suffix !== undefined %}
+ {% if params.prefix !== undefined %}
+ {% set prefixClass = " input-type--prefix" %}
+ {% endif %}
+
+ {% endif %}
+ {% endcall %}
{% endmacro %}
diff --git a/src/components/input/_template.njk b/src/components/input/_template.njk
deleted file mode 100644
index 5e46751935..0000000000
--- a/src/components/input/_template.njk
+++ /dev/null
@@ -1,67 +0,0 @@
-{% from "components/field/_macro.njk" import onsField %}
-{% from "components/label/_macro.njk" import onsLabel %}
-
-{% if params.type == "number" %}
-{# Type must be "text" or Firefox and Safari will set a blank value to the server if non numeric characters are entered -
- they don't block non numeric characters: https://bugzilla.mozilla.org/show_bug.cgi?id=1398528 #}
- {% set type = "text" %}
- {% set pattern = "[0-9]*" %}
- {% set inputmode = "numeric" %}
-{% elif params.type %}
- {% set type = params.type %}
-{% else %}
- {% set type = "text" %}
-{% endif %}
-
-{% set exclusiveClass = " js-exclusive-group" if params.mutuallyExclusive else "" %}
-
-{% call onsField({
- "id": params.fieldId,
- "classes": params.fieldClasses,
- "legendClasses": params.legendClasses,
- "noField": params.noField,
- "legend": params.label.text if params.mutuallyExclusive,
- "description": params.label.description if params.mutuallyExclusive,
- "mutuallyExclusive": params.mutuallyExclusive,
- "questionMode": params.questionMode
-}) %}
- {% if params.label and not params.mutuallyExclusive %}
- {{
- onsLabel({
- "for": params.id,
- "id": params.label.id,
- "text": params.label.text,
- "classes": params.label.classes,
- "description": params.label.description
- })
- }}
- {% endif %}
-
- {% if params.prefix !== undefined or params.suffix !== undefined %}
- {% if params.prefix !== undefined %}
- {% set prefixClass = " input-type--prefix" %}
- {% endif %}
-
- {% endif %}
-{% endcall %}
diff --git a/src/components/input/_test-template.njk b/src/components/input/_test-template.njk
new file mode 100644
index 0000000000..66fa21bc9c
--- /dev/null
+++ b/src/components/input/_test-template.njk
@@ -0,0 +1,3 @@
+{% from "components/input/_macro.njk" import onsInput %}
+
+{{ onsInput(params) }}
diff --git a/src/components/label/_macro.njk b/src/components/label/_macro.njk
index 5041ec9d0f..2f20deb532 100644
--- a/src/components/label/_macro.njk
+++ b/src/components/label/_macro.njk
@@ -1,3 +1,9 @@
{% macro onsLabel(params) %}
- {% include "components/label/_template.njk" %}
+
+ {{ params.text | safe }}
+ {% if params.description %}
+
+ {{ params.description }}
+ {% endif %}
+
{% endmacro %}
diff --git a/src/components/label/_template.njk b/src/components/label/_template.njk
deleted file mode 100644
index ab436e681b..0000000000
--- a/src/components/label/_template.njk
+++ /dev/null
@@ -1,7 +0,0 @@
-
- {{ params.text | safe }}
- {% if params.description %}
-
- {{ params.description }}
- {% endif %}
-
diff --git a/src/components/language-selector/_macro.njk b/src/components/language-selector/_macro.njk
index b219522ac2..99f74d591c 100644
--- a/src/components/language-selector/_macro.njk
+++ b/src/components/language-selector/_macro.njk
@@ -1,3 +1,32 @@
{% macro onsLanguageSelector(params) %}
- {% include "components/language-selector/_template.njk" %}
+ {% if params.languages | length <= 3 %}
+ {% set alternativeLanguages = params.languages | rejectattr("current") %}
+
+ {% else %}
+ {% set currentLanguage = params.languages | selectattr("current") | first %}
+
+ {% endif %}
{% endmacro %}
diff --git a/src/components/language-selector/_template.njk b/src/components/language-selector/_template.njk
deleted file mode 100644
index 8564fbfe31..0000000000
--- a/src/components/language-selector/_template.njk
+++ /dev/null
@@ -1,30 +0,0 @@
-{% if params.languages | length <= 3 %}
- {% set alternativeLanguages = params.languages | rejectattr("current") %}
-
-{% else %}
- {% set currentLanguage = params.languages | selectattr("current") | first %}
-
-{% endif %}
diff --git a/src/components/language-selector/_test-template.njk b/src/components/language-selector/_test-template.njk
new file mode 100644
index 0000000000..a3abfa55b8
--- /dev/null
+++ b/src/components/language-selector/_test-template.njk
@@ -0,0 +1,3 @@
+{% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
+
+{{ onsLanguageSelector(params) }}
diff --git a/src/components/lists/_macro.njk b/src/components/lists/_macro.njk
index 47847f3eb0..616e629f26 100644
--- a/src/components/lists/_macro.njk
+++ b/src/components/lists/_macro.njk
@@ -1,3 +1,21 @@
{% macro onsList(params) %}
- {% include "components/lists/_template.njk" %}
+ {% if params.element %}
+ {% set listEl = params.element | lower %}
+ {% else %}
+ {% set listEl = 'ul' %}
+ {% endif %}
+
+ <{{listEl}} {% if params.id %}id="{{ params.id }}"{% endif %} class="list {{ params.classes }}">
+ {% for item in params.items %}
+
+ {% if item.url %}
+ {% if item.index %}{{ loop.index }}) {% endif %}
+ {{ item.text | safe }}
+
+ {% else %}
+ {{ item.text | safe }}
+ {% endif %}
+
+ {% endfor %}
+ {{listEl}}>
{% endmacro %}
diff --git a/src/components/lists/_template.njk b/src/components/lists/_template.njk
deleted file mode 100644
index a594ae5d48..0000000000
--- a/src/components/lists/_template.njk
+++ /dev/null
@@ -1,19 +0,0 @@
-{% if params.element %}
- {% set listEl = params.element | lower %}
-{% else %}
- {% set listEl = 'ul' %}
-{% endif %}
-
-<{{listEl}} {% if params.id %}id="{{ params.id }}"{% endif %} class="list {{ params.classes }}">
- {% for item in params.items %}
-
- {% if item.url %}
- {% if item.index %}{{ loop.index }}) {% endif %}
- {{ item.text | safe }}
-
- {% else %}
- {{ item.text | safe }}
- {% endif %}
-
- {% endfor %}
-{{listEl}}>
diff --git a/src/components/metadata/_macro.njk b/src/components/metadata/_macro.njk
index 5bf662d0f7..48aab8e1fa 100644
--- a/src/components/metadata/_macro.njk
+++ b/src/components/metadata/_macro.njk
@@ -1,3 +1,12 @@
{% macro onsMetadata(params) %}
- {% include "components/metadata/_template.njk" %}
+
+ {% if params.items %}
+ {% for item in params.items %}
+ {{ item.term }}
+ {% for description in item.descriptions %}
+ {{ description.description }}
+ {% endfor %}
+ {% endfor %}
+ {% endif %}
+
{% endmacro %}
diff --git a/src/components/metadata/_template.njk b/src/components/metadata/_template.njk
deleted file mode 100644
index 1cf826c0c3..0000000000
--- a/src/components/metadata/_template.njk
+++ /dev/null
@@ -1,10 +0,0 @@
-
-{% if params.items %}
- {% for item in params.items %}
- {{ item.term }}
- {% for description in item.descriptions %}
- {{ description.description }}
- {% endfor %}
- {% endfor %}
-{% endif %}
-
diff --git a/src/components/pagination/_macro.njk b/src/components/pagination/_macro.njk
index 3db1d2b338..583ebb214f 100644
--- a/src/components/pagination/_macro.njk
+++ b/src/components/pagination/_macro.njk
@@ -1,3 +1,83 @@
{% macro onsPagination(params) %}
- {% include "components/pagination/_template.njk" %}
+ {% set currentPageIndex = "" %}
+ {% for page in params.pages %}
+ {% if page.current %}
+ {% set currentPageIndex = loop.index %}
+ {% endif %}
+ {% endfor %}
+
+ {% set totalPages = params.pages | length %}
+ {% set position = "Page " + currentPageIndex + " of " + totalPages %}
+
+ {# Calculate middle pages #}
+ {% set middlePageCount = 5 %}
+ {% set middlePagesEachSide = (middlePageCount - 1) / 2 %}
+
+ {% if (currentPageIndex - middlePagesEachSide) <= 1 %}
+ {% set geoff = '1' %}
+ {% set middlePagesStart = 1 %}
+ {% set middlePagesEnd = middlePageCount - 1 %}
+ {% elif (currentPageIndex + middlePagesEachSide) >= totalPages %}
+ {% set geoff = '2' %}
+ {% set middlePagesStart = totalPages - middlePageCount + 1 %}
+ {% set middlePagesEnd = totalPages %}
+ {% else %}
+ {% set geoff = '3' %}
+ {% set middlePagesStart = currentPageIndex - middlePagesEachSide %}
+ {% set middlePagesEnd = currentPageIndex + middlePagesEachSide %}
+ {% endif %}
+
+
+
{% endmacro %}
diff --git a/src/components/pagination/_template.njk b/src/components/pagination/_template.njk
deleted file mode 100644
index 7d579740bf..0000000000
--- a/src/components/pagination/_template.njk
+++ /dev/null
@@ -1,81 +0,0 @@
-{% set currentPageIndex = "" %}
-{% for page in params.pages %}
- {% if page.current %}
- {% set currentPageIndex = loop.index %}
- {% endif %}
-{% endfor %}
-
-{% set totalPages = params.pages | length %}
-{% set position = "Page " + currentPageIndex + " of " + totalPages %}
-
-{# Calculate middle pages #}
-{% set middlePageCount = 5 %}
-{% set middlePagesEachSide = (middlePageCount - 1) / 2 %}
-
-{% if (currentPageIndex - middlePagesEachSide) <= 1 %}
- {% set geoff = '1' %}
- {% set middlePagesStart = 1 %}
- {% set middlePagesEnd = middlePageCount - 1 %}
-{% elif (currentPageIndex + middlePagesEachSide) >= totalPages %}
- {% set geoff = '2' %}
- {% set middlePagesStart = totalPages - middlePageCount + 1 %}
- {% set middlePagesEnd = totalPages %}
-{% else %}
- {% set geoff = '3' %}
- {% set middlePagesStart = currentPageIndex - middlePagesEachSide %}
- {% set middlePagesEnd = currentPageIndex + middlePagesEachSide %}
-{% endif %}
-
-
-
diff --git a/src/components/panel/_macro.njk b/src/components/panel/_macro.njk
index f73cd76110..10f87682bd 100644
--- a/src/components/panel/_macro.njk
+++ b/src/components/panel/_macro.njk
@@ -1,3 +1,28 @@
{% macro onsPanel(params) %}
- {% include "components/panel/_template.njk" %}
+ {% if params.classes %}
+ {% set utilityClasses = ' ' + params.classes %}
+ {% endif %}
+
+ {% if params.title === undefined %}
+ {% set simpleClass = ' panel--simple' %}
+ {% endif %}
+
+ {% if params.type %}
+ {% set typeClass = ' panel--' + params.type %}
+ {% else %}
+ {% set typeClass = ' panel--info' %}
+ {% endif %}
+
+ {% if params.spacious %}
+ {% set spaciousClass = ' panel--spacious' %}
+ {% endif %}
+
+
+ {% if params.title %} {% endif %}
+
{{ params.body | safe }}
+ {{ caller() if caller }}
+
+
{% endmacro %}
diff --git a/src/components/panel/_template.njk b/src/components/panel/_template.njk
deleted file mode 100644
index d0392c9b44..0000000000
--- a/src/components/panel/_template.njk
+++ /dev/null
@@ -1,26 +0,0 @@
-{% if params.classes %}
- {% set utilityClasses = ' ' + params.classes %}
-{% endif %}
-
-{% if params.title === undefined %}
- {% set simpleClass = ' panel--simple' %}
-{% endif %}
-
-{% if params.type %}
- {% set typeClass = ' panel--' + params.type %}
-{% else %}
- {% set typeClass = ' panel--info' %}
-{% endif %}
-
-{% if params.spacious %}
- {% set spaciousClass = ' panel--spacious' %}
-{% endif %}
-
-
- {% if params.title %} {% endif %}
-
{{ params.body | safe }}
- {{ caller() if caller }}
-
-
diff --git a/src/components/password/_macro.njk b/src/components/password/_macro.njk
index e2b5996b6e..67fcd30820 100644
--- a/src/components/password/_macro.njk
+++ b/src/components/password/_macro.njk
@@ -1,3 +1,39 @@
{% macro onsPassword(params) %}
- {% include "components/password/_template.njk" %}
+ {% from "components/field/_macro.njk" import onsField %}
+ {% from "components/label/_macro.njk" import onsLabel %}
+ {% from "components/checkboxes/_checkbox-macro.njk" import onsCheckbox %}
+ {% from "components/input/_macro.njk" import onsInput %}
+
+ {% call onsField({
+ "id": params.fieldId,
+ "classes": params.fieldClasses
+ }) %}
+ {{
+ onsLabel({
+ "for": params.id,
+ "text": params.label.text,
+ "description": params.label.description,
+ "classes": params.label.classes
+ })
+ }}
+ {{
+ onsCheckbox({
+ "id": params.id + "-toggle",
+ "classes": "js-password-toggle-wrap checkbox--toggle u-d-no",
+ "inputClasses": "js-password-toggle",
+ "name": "show-password",
+ "label": {
+ "text": params.showPasswordText
+ }
+ })
+ }}
+ {{
+ onsInput({
+ "id": params.id,
+ "type": "password",
+ "classes": "u-mt-xs js-password",
+ "noField": true
+ })
+ }}
+ {% endcall %}
{% endmacro %}
diff --git a/src/components/password/_template.njk b/src/components/password/_template.njk
deleted file mode 100644
index ef5296adfc..0000000000
--- a/src/components/password/_template.njk
+++ /dev/null
@@ -1,37 +0,0 @@
-{% from "components/field/_macro.njk" import onsField %}
-{% from "components/label/_macro.njk" import onsLabel %}
-{% from "components/checkboxes/_checkbox-macro.njk" import onsCheckbox %}
-{% from "components/input/_macro.njk" import onsInput %}
-
-{% call onsField({
- "id": params.fieldId,
- "classes": params.fieldClasses
-}) %}
- {{
- onsLabel({
- "for": params.id,
- "text": params.label.text,
- "description": params.label.description,
- "classes": params.label.classes
- })
- }}
- {{
- onsCheckbox({
- "id": params.id + "-toggle",
- "classes": "js-password-toggle-wrap checkbox--toggle u-d-no",
- "inputClasses": "js-password-toggle",
- "name": "show-password",
- "label": {
- "text": params.showPasswordText
- }
- })
- }}
- {{
- onsInput({
- "id": params.id,
- "type": "password",
- "classes": "u-mt-xs js-password",
- "noField": true
- })
- }}
-{% endcall %}
diff --git a/src/components/password/_test-template.njk b/src/components/password/_test-template.njk
new file mode 100644
index 0000000000..2edbdd513d
--- /dev/null
+++ b/src/components/password/_test-template.njk
@@ -0,0 +1,3 @@
+{% from "components/password/_macro.njk" import onsPassword %}
+
+{{ onsPassword(params) }}
diff --git a/src/components/phase-banner/_macro.njk b/src/components/phase-banner/_macro.njk
index 3fa1dbc404..b28311ffb0 100644
--- a/src/components/phase-banner/_macro.njk
+++ b/src/components/phase-banner/_macro.njk
@@ -1,3 +1,14 @@
{% macro onsPhaseBanner(params) %}
- {% include "components/phase-banner/_template.njk" %}
+
+
+
+
+
{{ params.badge | default("Beta") }}
+
+
+
{{ params.html | safe }}
+
+
+
+
{% endmacro %}
diff --git a/src/components/phase-banner/_template.njk b/src/components/phase-banner/_template.njk
deleted file mode 100644
index 17ae9def16..0000000000
--- a/src/components/phase-banner/_template.njk
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
{{ params.badge | default("Beta") }}
-
-
-
{{ params.html | safe }}
-
-
-
-
diff --git a/src/components/radios/_macro.njk b/src/components/radios/_macro.njk
index 8a8dbe9254..987086f5dc 100644
--- a/src/components/radios/_macro.njk
+++ b/src/components/radios/_macro.njk
@@ -1,3 +1,51 @@
{% macro onsRadios(params) %}
- {% include "components/radios/_template.njk" %}
+ {% from "components/field/_macro.njk" import onsField %}
+
+ {% call onsField({
+ "id": params.id,
+ "legend": params.legend,
+ "description": params.description,
+ "classes": params.classes,
+ "legendClasses": params.legendClasses,
+ "questionMode": params.questionMode
+ }) %}
+
+ {% for radio in params.radios %}
+
+
+
+ {# aria-hidden is used to prevent screen readers from being able to focus the individual elements within a label, and combined with aria-labeledby on the input to ensure the label is still read #}
+
+ {{ radio.label.text | safe }}
+ {% if radio.label.description %}
+
+ {{ radio.label.description }}
+ {% endif %}
+
+ {% if radio.other %}
+
+ {% from "components/input/_macro.njk" import onsInput %}
+ {{
+ onsInput({
+ "id": radio.other.id,
+ "name": radio.other.name,
+ "type": radio.other.type,
+ "classes": "input--w-auto " + radio.other.classes | default(''),
+ "attributes": radio.other.attributes,
+ "label": {
+ "text": radio.other.label.text,
+ "classes": 'u-fs-s--b'
+ }
+ })
+ }}
+
+ {% endif %}
+
+
+ {% if not loop.last %}
+
+ {% endif %}
+ {% endfor %}
+
+ {% endcall %}
{% endmacro %}
diff --git a/src/components/radios/_template.njk b/src/components/radios/_template.njk
deleted file mode 100644
index cdcde49edc..0000000000
--- a/src/components/radios/_template.njk
+++ /dev/null
@@ -1,49 +0,0 @@
-{% from "components/field/_macro.njk" import onsField %}
-
-{% call onsField({
- "id": params.id,
- "legend": params.legend,
- "description": params.description,
- "classes": params.classes,
- "legendClasses": params.legendClasses,
- "questionMode": params.questionMode
-}) %}
-
- {% for radio in params.radios %}
-
-
-
- {# aria-hidden is used to prevent screen readers from being able to focus the individual elements within a label, and combined with aria-labeledby on the input to ensure the label is still read #}
-
- {{ radio.label.text | safe }}
- {% if radio.label.description %}
-
- {{ radio.label.description }}
- {% endif %}
-
- {% if radio.other %}
-
- {% from "components/input/_macro.njk" import onsInput %}
- {{
- onsInput({
- "id": radio.other.id,
- "name": radio.other.name,
- "type": radio.other.type,
- "classes": "input--w-auto " + radio.other.classes | default(''),
- "attributes": radio.other.attributes,
- "label": {
- "text": radio.other.label.text,
- "classes": 'u-fs-s--b'
- }
- })
- }}
-
- {% endif %}
-
-
- {% if not loop.last %}
-
- {% endif %}
- {% endfor %}
-
-{% endcall %}
diff --git a/src/components/section-navigation/_macro.njk b/src/components/section-navigation/_macro.njk
index 8daeaf6154..a3a95964c4 100644
--- a/src/components/section-navigation/_macro.njk
+++ b/src/components/section-navigation/_macro.njk
@@ -1,3 +1,11 @@
{% macro onsSectionNavigation(params) %}
- {% include "components/section-navigation/_template.njk" %}
+
+
+
{% endmacro %}
diff --git a/src/components/section-navigation/_template.njk b/src/components/section-navigation/_template.njk
deleted file mode 100644
index b2de3aba49..0000000000
--- a/src/components/section-navigation/_template.njk
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
diff --git a/src/components/select/_macro.njk b/src/components/select/_macro.njk
index 930262527a..ff09c305a0 100644
--- a/src/components/select/_macro.njk
+++ b/src/components/select/_macro.njk
@@ -1,3 +1,42 @@
{% macro onsSelect(params) %}
- {% include "components/select/_template.njk" %}
+ {% from "components/field/_macro.njk" import onsField %}
+
+ {% set exclusiveClass = " js-exclusive-group" if params.mutuallyExclusive else "" %}
+
+ {% call onsField({
+ "id": params.fieldId,
+ "legend": params.label.text if params.mutuallyExclusive,
+ "description": params.label.description if params.mutuallyExclusive,
+ "mutuallyExclusive": params.mutuallyExclusive,
+ "classes": params.fieldClases,
+ "legendClasses": params.legendClasses,
+ "questionMode": params.questionMode
+ }) %}
+ {% if params.label and not params.mutuallyExclusive %}
+ {% from "components/label/_macro.njk" import onsLabel %}
+ {{
+ onsLabel({
+ "for": params.id,
+ "text": params.label.text,
+ "description": params.label.description,
+ "classes": params.label.classes
+ })
+ }}
+ {% endif %}
+
+ {% for option in params.options %}
+
+ {{ option.text }}
+
+ {% endfor %}
+
+ {% endcall %}
{% endmacro %}
diff --git a/src/components/select/_template.njk b/src/components/select/_template.njk
deleted file mode 100644
index 952ff5aeff..0000000000
--- a/src/components/select/_template.njk
+++ /dev/null
@@ -1,40 +0,0 @@
-{% from "components/field/_macro.njk" import onsField %}
-
-{% set exclusiveClass = " js-exclusive-group" if params.mutuallyExclusive else "" %}
-
-{% call onsField({
- "id": params.fieldId,
- "legend": params.label.text if params.mutuallyExclusive,
- "description": params.label.description if params.mutuallyExclusive,
- "mutuallyExclusive": params.mutuallyExclusive,
- "classes": params.fieldClases,
- "legendClasses": params.legendClasses,
- "questionMode": params.questionMode
-}) %}
- {% if params.label and not params.mutuallyExclusive %}
- {% from "components/label/_macro.njk" import onsLabel %}
- {{
- onsLabel({
- "for": params.id,
- "text": params.label.text,
- "description": params.label.description,
- "classes": params.label.classes
- })
- }}
- {% endif %}
-
- {% for option in params.options %}
-
- {{ option.text }}
-
- {% endfor %}
-
-{% endcall %}
diff --git a/src/components/select/_test-template.njk b/src/components/select/_test-template.njk
new file mode 100644
index 0000000000..18b038a66a
--- /dev/null
+++ b/src/components/select/_test-template.njk
@@ -0,0 +1,2 @@
+{% from "components/select/_macro.njk" import onsSelect %}
+{{ onsSelect(params) }}
diff --git a/src/components/status/_macro.njk b/src/components/status/_macro.njk
index 905f93f24b..8aff150489 100644
--- a/src/components/status/_macro.njk
+++ b/src/components/status/_macro.njk
@@ -1,3 +1,13 @@
{% macro onsStatus(params) %}
- {% include "components/status/_template.njk" %}
+ {% if params.type %}
+ {% set typeClass = ' status--' + params.type %}
+ {% else %}
+ {% set typeClass = ' status--info' %}
+ {% endif %}
+
+ {% if params.size == 'small' %}
+ {% set sizeClass = ' status--small' %}
+ {% endif %}
+
+ {{ params.label }}
{% endmacro %}
diff --git a/src/components/status/_template.njk b/src/components/status/_template.njk
deleted file mode 100644
index 34cd5767c4..0000000000
--- a/src/components/status/_template.njk
+++ /dev/null
@@ -1,13 +0,0 @@
-{% from "components/status/_macro.njk" import onsStatus %}
-
-{% if params.type %}
- {% set typeClass = ' status--' + params.type %}
-{% else %}
- {% set typeClass = ' status--info' %}
-{% endif %}
-
-{% if params.size == 'small' %}
- {% set sizeClass = ' status--small' %}
-{% endif %}
-
-{{ params.label }}
diff --git a/src/components/summary/_macro.njk b/src/components/summary/_macro.njk
index 8876c9bb7c..12966759a5 100644
--- a/src/components/summary/_macro.njk
+++ b/src/components/summary/_macro.njk
@@ -1,3 +1,32 @@
{% macro onsSummary(params) %}
- {% include "components/summary/_template.njk" %}
+
+ {% if params.title %}
+
{{ params.title }}
+ {% endif %}
+
+ {% for item in params.items %}
+ {% set itemClass = "" %}
+ {% if item.error %} {% set itemClass = " summary__item--error" %}{% endif %}
+ {% if item.total %} {% set itemClass = itemClass + " summary__item--total" %}{% endif %}
+
+ {% if item.title %}
+
+ {{ item.title }}
+
+ {% endif %}
+ {% for question in item.questions %}
+
+ {{ question.question }}
+ {{ question.answer | safe }}
+ {% if question.action %}
+
+ {{ question.action.text }}
+
+ {% endif %}
+
+ {% endfor %}
+
+ {% endfor %}
+
+
{% endmacro %}
diff --git a/src/components/summary/_template.njk b/src/components/summary/_template.njk
deleted file mode 100644
index c256534ce4..0000000000
--- a/src/components/summary/_template.njk
+++ /dev/null
@@ -1,30 +0,0 @@
-
- {% if params.title %}
-
{{ params.title }}
- {% endif %}
-
- {% for item in params.items %}
- {% set itemClass = "" %}
- {% if item.error %} {% set itemClass = " summary__item--error" %}{% endif %}
- {% if item.total %} {% set itemClass = itemClass + " summary__item--total" %}{% endif %}
-
- {% if item.title %}
-
- {{ item.title }}
-
- {% endif %}
- {% for question in item.questions %}
-
- {{ question.question }}
- {{ question.answer | safe }}
- {% if question.action %}
-
- {{ question.action.text }}
-
- {% endif %}
-
- {% endfor %}
-
- {% endfor %}
-
-
diff --git a/src/components/table/_macro.njk b/src/components/table/_macro.njk
index d0826d6fa4..8f4d2b7dc5 100644
--- a/src/components/table/_macro.njk
+++ b/src/components/table/_macro.njk
@@ -1,3 +1,40 @@
{% macro onsTable(params) %}
- {% include "components/table/_template.njk" %}
+ {% if params.scrollable %}
+
+ {% endif %}
{% endmacro %}
diff --git a/src/components/table/_template.njk b/src/components/table/_template.njk
deleted file mode 100644
index 2dd219f868..0000000000
--- a/src/components/table/_template.njk
+++ /dev/null
@@ -1,38 +0,0 @@
-{% if params.scrollable %}
-
-{% endif %}
diff --git a/src/components/table/_test-template.njk b/src/components/table/_test-template.njk
new file mode 100644
index 0000000000..f206711255
--- /dev/null
+++ b/src/components/table/_test-template.njk
@@ -0,0 +1,2 @@
+{% from "components/table/_macro.njk" import onsTable %}
+{{ onsTable(params) }}
diff --git a/src/components/tabs/_macro.njk b/src/components/tabs/_macro.njk
index ec1b757258..62e48560a8 100644
--- a/src/components/tabs/_macro.njk
+++ b/src/components/tabs/_macro.njk
@@ -1,3 +1,15 @@
{% macro onsTabs(params) %}
- {% include "components/tabs/_template.njk" %}
+
+ {{params.title}}
+
+ {% for tab in params.tabs %}
+
+ {{tab.content | safe}}
+
+ {% endfor %}
+
{% endmacro %}
diff --git a/src/components/tabs/_template.njk b/src/components/tabs/_template.njk
deleted file mode 100644
index ab8c36a72b..0000000000
--- a/src/components/tabs/_template.njk
+++ /dev/null
@@ -1,13 +0,0 @@
-
- {{params.title}}
-
- {% for tab in params.tabs %}
-
- {{tab.content | safe}}
-
- {% endfor %}
-
diff --git a/src/components/tabs/_test-template.njk b/src/components/tabs/_test-template.njk
new file mode 100644
index 0000000000..ed066d6bfc
--- /dev/null
+++ b/src/components/tabs/_test-template.njk
@@ -0,0 +1,3 @@
+{% from "components/tabs/_macro.njk" import onsTabs %}
+
+{{ onsTabs(params) }}
diff --git a/src/components/textarea/_macro.njk b/src/components/textarea/_macro.njk
index 4cb1691894..d94a538c6a 100644
--- a/src/components/textarea/_macro.njk
+++ b/src/components/textarea/_macro.njk
@@ -1,3 +1,44 @@
{% macro onsTextarea(params) %}
- {% include "components/textarea/_template.njk" %}
+ {% from "components/field/_macro.njk" import onsField %}
+
+ {% call onsField({
+ "id": params.fieldId,
+ "legend": params.label.text if params.mutuallyExclusive,
+ "description": params.label.description if params.mutuallyExclusive,
+ "mutuallyExclusive": params.mutuallyExclusive,
+ "classes": params.fieldClasses,
+ "legendClasses": params.legendClasses
+ }) %}
+ {% if params.mutuallyExclusive %}
+ {% set textareaExlusiveClass = " js-exclusive-group" %}
+ {% else %}
+ {% from "components/label/_macro.njk" import onsLabel %}
+ {{
+ onsLabel({
+ "for": params.id,
+ "text": params.label.text,
+ "description": params.label.description,
+ "classes": params.label.classes
+ })
+ }}
+ {% endif %}
+
+ {% if params.maxlength %}
+
+
+ {% endif %}
+ {% endcall %}
{% endmacro %}
diff --git a/src/components/textarea/_template.njk b/src/components/textarea/_template.njk
deleted file mode 100644
index 0d286de419..0000000000
--- a/src/components/textarea/_template.njk
+++ /dev/null
@@ -1,42 +0,0 @@
-{% from "components/field/_macro.njk" import onsField %}
-
-{% call onsField({
- "id": params.fieldId,
- "legend": params.label.text if params.mutuallyExclusive,
- "description": params.label.description if params.mutuallyExclusive,
- "mutuallyExclusive": params.mutuallyExclusive,
- "classes": params.fieldClasses,
- "legendClasses": params.legendClasses
-}) %}
- {% if params.mutuallyExclusive %}
- {% set textareaExlusiveClass = " js-exclusive-group" %}
- {% else %}
- {% from "components/label/_macro.njk" import onsLabel %}
- {{
- onsLabel({
- "for": params.id,
- "text": params.label.text,
- "description": params.label.description,
- "classes": params.label.classes
- })
- }}
- {% endif %}
-
- {% if params.maxlength %}
-
-
- {% endif %}
-{% endcall %}
diff --git a/src/components/textarea/_test-template.njk b/src/components/textarea/_test-template.njk
new file mode 100644
index 0000000000..e3bfc126ae
--- /dev/null
+++ b/src/components/textarea/_test-template.njk
@@ -0,0 +1,3 @@
+{% from "components/textarea/_macro.njk" import onsTextarea %}
+
+{{ onsTextarea(params) }}
diff --git a/src/components/upload/_macro.njk b/src/components/upload/_macro.njk
index 2c1fd84dac..915bf538c0 100644
--- a/src/components/upload/_macro.njk
+++ b/src/components/upload/_macro.njk
@@ -1,3 +1,28 @@
{% macro onsUpload(params) %}
- {% include "components/upload/_template.njk" %}
+ {% from "components/field/_macro.njk" import onsField %}
+ {% from "components/label/_macro.njk" import onsLabel %}
+ {% from "components/input/_macro.njk" import onsInput %}
+
+ {% call onsField({
+ "id": params.fieldId,
+ "classes": params.fieldClasses
+ }) %}
+ {{
+ onsLabel({
+ "for": params.id,
+ "text": params.label.text,
+ "description": params.label.description
+ })
+ }}
+ {{
+ onsInput({
+ "id": params.id,
+ "type": "file",
+ "classes": "input--upload",
+ "accept": params.accept,
+ "name": "file",
+ "noField": true
+ })
+ }}
+ {% endcall %}
{% endmacro %}
diff --git a/src/components/upload/_template.njk b/src/components/upload/_template.njk
deleted file mode 100644
index 713378845e..0000000000
--- a/src/components/upload/_template.njk
+++ /dev/null
@@ -1,26 +0,0 @@
-{% from "components/field/_macro.njk" import onsField %}
-{% from "components/label/_macro.njk" import onsLabel %}
-{% from "components/input/_macro.njk" import onsInput %}
-
-{% call onsField({
- "id": params.fieldId,
- "classes": params.fieldClasses
-}) %}
- {{
- onsLabel({
- "for": params.id,
- "text": params.label.text,
- "description": params.label.description
- })
- }}
- {{
- onsInput({
- "id": params.id,
- "type": "file",
- "classes": "input--upload",
- "accept": params.accept,
- "name": "file",
- "noField": true
- })
- }}
-{% endcall %}
diff --git a/src/tests/spec/collapsible/collapsible-accordion.spec.js b/src/tests/spec/collapsible/collapsible-accordion.spec.js
index 83b5e242bd..958e7267fc 100644
--- a/src/tests/spec/collapsible/collapsible-accordion.spec.js
+++ b/src/tests/spec/collapsible/collapsible-accordion.spec.js
@@ -1,5 +1,5 @@
import { awaitPolyfills } from 'js/polyfills/await-polyfills';
-import template from 'components/accordion/_template.njk';
+import template from 'components/accordion/_test-template.njk';
import collapsible, { Collapsible } from 'components/details/collapsible';
import CollapsibleGroup from 'components/details/collapsible.group';
import eventMock from 'stubs/event.stub.spec';
diff --git a/src/tests/spec/collapsible/collapsible.spec.js b/src/tests/spec/collapsible/collapsible.spec.js
index 03853346e4..2765b2b597 100644
--- a/src/tests/spec/collapsible/collapsible.spec.js
+++ b/src/tests/spec/collapsible/collapsible.spec.js
@@ -1,5 +1,5 @@
import { awaitPolyfills } from 'js/polyfills/await-polyfills';
-import template from 'components/details/_template.njk';
+import template from 'components/details/_test-template.njk';
import collapsible, { Collapsible } from 'components/details/collapsible';
const params = {
diff --git a/src/tests/spec/feedback/feedback.spec.js b/src/tests/spec/feedback/feedback.spec.js
index 5eea2199ae..50c56630a3 100644
--- a/src/tests/spec/feedback/feedback.spec.js
+++ b/src/tests/spec/feedback/feedback.spec.js
@@ -1,5 +1,5 @@
import { awaitPolyfills } from 'js/polyfills/await-polyfills';
-import template from 'components/feedback/_template.njk';
+import template from 'components/feedback/_test-template.njk';
import Feedback from 'components/feedback/feedback';
import fetchMock from 'stubs/window.fetch.stub.spec';
diff --git a/src/tests/spec/header-navigation/header-navigation.spec.js b/src/tests/spec/header-navigation/header-navigation.spec.js
index fa6c0a9c7e..bb68950c25 100644
--- a/src/tests/spec/header-navigation/header-navigation.spec.js
+++ b/src/tests/spec/header-navigation/header-navigation.spec.js
@@ -1,5 +1,5 @@
import { awaitPolyfills } from 'js/polyfills/await-polyfills';
-import template from 'components/header/_template.njk';
+import template from 'components/header/_test-template.njk';
const params = {
toggleButton: {
diff --git a/src/tests/spec/language-selector/language.spec.js b/src/tests/spec/language-selector/language.spec.js
index 418e0f231e..f1dc7c834e 100644
--- a/src/tests/spec/language-selector/language.spec.js
+++ b/src/tests/spec/language-selector/language.spec.js
@@ -1,5 +1,5 @@
import { awaitPolyfills } from 'js/polyfills/await-polyfills';
-import template from 'components/language-selector/_template.njk';
+import template from 'components/language-selector/_test-template.njk';
import LanguageSelector from 'components/language-selector/language';
import eventMock from 'stubs/event.stub.spec';
import { throttle } from 'throttle-typescript';
diff --git a/src/tests/spec/mutually-exclusive/mutually-exclusive-checkboxes.spec.js b/src/tests/spec/mutually-exclusive/mutually-exclusive-checkboxes.spec.js
index bbb8143071..23d6d2a2a1 100644
--- a/src/tests/spec/mutually-exclusive/mutually-exclusive-checkboxes.spec.js
+++ b/src/tests/spec/mutually-exclusive/mutually-exclusive-checkboxes.spec.js
@@ -1,5 +1,5 @@
import { awaitPolyfills } from 'js/polyfills/await-polyfills';
-import template from 'components/checkboxes/_template.njk';
+import template from 'components/checkboxes/_test-template.njk';
import mutuallyExclusive from 'components/mutually-exclusive/mutually-exclusive';
const params = {
diff --git a/src/tests/spec/mutually-exclusive/mutually-exclusive-date.spec.js b/src/tests/spec/mutually-exclusive/mutually-exclusive-date.spec.js
index 74080f3119..053c04a31f 100644
--- a/src/tests/spec/mutually-exclusive/mutually-exclusive-date.spec.js
+++ b/src/tests/spec/mutually-exclusive/mutually-exclusive-date.spec.js
@@ -1,5 +1,5 @@
import { awaitPolyfills } from 'js/polyfills/await-polyfills';
-import template from 'components/date-input/_template.njk';
+import template from 'components/date-input/_test-template.njk';
import mutuallyExclusive from 'components/mutually-exclusive/mutually-exclusive';
const params = {
diff --git a/src/tests/spec/mutually-exclusive/mutually-exclusive-email.spec.js b/src/tests/spec/mutually-exclusive/mutually-exclusive-email.spec.js
index 763f0fe2cb..f335cfd8c3 100644
--- a/src/tests/spec/mutually-exclusive/mutually-exclusive-email.spec.js
+++ b/src/tests/spec/mutually-exclusive/mutually-exclusive-email.spec.js
@@ -1,5 +1,5 @@
import { awaitPolyfills } from 'js/polyfills/await-polyfills';
-import template from 'components/input/_template.njk';
+import template from 'components/input/_test-template.njk';
import mutuallyExclusive from 'components/mutually-exclusive/mutually-exclusive';
const params = {
diff --git a/src/tests/spec/mutually-exclusive/mutually-exclusive-number.spec.js b/src/tests/spec/mutually-exclusive/mutually-exclusive-number.spec.js
index 2864181cb3..b490c061e0 100644
--- a/src/tests/spec/mutually-exclusive/mutually-exclusive-number.spec.js
+++ b/src/tests/spec/mutually-exclusive/mutually-exclusive-number.spec.js
@@ -1,5 +1,5 @@
import { awaitPolyfills } from 'js/polyfills/await-polyfills';
-import template from 'components/input/_template.njk';
+import template from 'components/input/_test-template.njk';
import mutuallyExclusive from 'components/mutually-exclusive/mutually-exclusive';
const params = {
diff --git a/src/tests/spec/mutually-exclusive/mutually-exclusive-select.spec.js b/src/tests/spec/mutually-exclusive/mutually-exclusive-select.spec.js
index 761058fadc..571bb2a558 100644
--- a/src/tests/spec/mutually-exclusive/mutually-exclusive-select.spec.js
+++ b/src/tests/spec/mutually-exclusive/mutually-exclusive-select.spec.js
@@ -1,5 +1,5 @@
import { awaitPolyfills } from 'js/polyfills/await-polyfills';
-import template from 'components/select/_template.njk';
+import template from 'components/select/_test-template.njk';
import mutuallyExclusive from 'components/mutually-exclusive/mutually-exclusive';
const params = {
diff --git a/src/tests/spec/mutually-exclusive/mutually-exclusive-textarea.spec.js b/src/tests/spec/mutually-exclusive/mutually-exclusive-textarea.spec.js
index 2c9c3a8030..ca6a19186f 100644
--- a/src/tests/spec/mutually-exclusive/mutually-exclusive-textarea.spec.js
+++ b/src/tests/spec/mutually-exclusive/mutually-exclusive-textarea.spec.js
@@ -1,5 +1,5 @@
import { awaitPolyfills } from 'js/polyfills/await-polyfills';
-import template from 'components/textarea/_template.njk';
+import template from 'components/textarea/_test-template.njk';
import mutuallyExclusive from 'components/mutually-exclusive/mutually-exclusive';
import characterLimit from 'components/textarea/character-limit';
import { populateTextarea } from '../textarea/character-limit.spec';
diff --git a/src/tests/spec/password/password.spec.js b/src/tests/spec/password/password.spec.js
index 302b8780f8..be7eebd770 100644
--- a/src/tests/spec/password/password.spec.js
+++ b/src/tests/spec/password/password.spec.js
@@ -1,5 +1,5 @@
import { awaitPolyfills } from 'js/polyfills/await-polyfills';
-import template from 'components/password/_template.njk';
+import template from 'components/password/_test-template.njk';
import password from 'components/password/password';
const params = {
diff --git a/src/tests/spec/table/table-scrollable.spec.js b/src/tests/spec/table/table-scrollable.spec.js
index d44f1f3bf1..55117a022c 100644
--- a/src/tests/spec/table/table-scrollable.spec.js
+++ b/src/tests/spec/table/table-scrollable.spec.js
@@ -1,5 +1,5 @@
import { awaitPolyfills } from 'js/polyfills/await-polyfills';
-import template from 'components/table/_template.njk';
+import template from 'components/table/_test-template.njk';
import tableScroll from 'components/table/scrollable-table';
const params = {
diff --git a/src/tests/spec/table/table-sortable.spec.js b/src/tests/spec/table/table-sortable.spec.js
index 98cd3fc10b..57668a3ace 100644
--- a/src/tests/spec/table/table-sortable.spec.js
+++ b/src/tests/spec/table/table-sortable.spec.js
@@ -1,5 +1,5 @@
import { awaitPolyfills } from 'js/polyfills/await-polyfills';
-import template from 'components/table/_template.njk';
+import template from 'components/table/_test-template.njk';
import tableSorter from 'components/table/sortable-table';
const params = {
diff --git a/src/tests/spec/tabs/tabs.spec.js b/src/tests/spec/tabs/tabs.spec.js
index 88f19a6ac6..2e22be0b4e 100644
--- a/src/tests/spec/tabs/tabs.spec.js
+++ b/src/tests/spec/tabs/tabs.spec.js
@@ -1,5 +1,5 @@
import { awaitPolyfills } from 'js/polyfills/await-polyfills';
-import template from 'components/tabs/_template.njk';
+import template from 'components/tabs/_test-template.njk';
import matchMediaDesktopMock from 'stubs/matchMediaDesktop.stub.spec';
import matchMediaMobileMock from 'stubs/matchMediaMobile.stub.spec';
import eventMock from 'stubs/event.stub.spec';
diff --git a/src/tests/spec/textarea/character-limit.spec.js b/src/tests/spec/textarea/character-limit.spec.js
index 87fea4eca3..f84a72d86d 100644
--- a/src/tests/spec/textarea/character-limit.spec.js
+++ b/src/tests/spec/textarea/character-limit.spec.js
@@ -1,5 +1,5 @@
import { awaitPolyfills } from 'js/polyfills/await-polyfills';
-import template from 'components/textarea/_template.njk';
+import template from 'components/textarea/_test-template.njk';
import charLimit from 'components/textarea/character-limit';
const params = {
diff --git a/src/views/partials/example/_macro.njk b/src/views/partials/example/_macro.njk
index b363ddd908..c873b6f9f3 100644
--- a/src/views/partials/example/_macro.njk
+++ b/src/views/partials/example/_macro.njk
@@ -1,4 +1,67 @@
{% macro patternlibExample(params) %}
{% set params = helpers.generateExampleParams(params, helpers.addDependency) %}
- {% include "./_template.njk" %}
+
+
+
+
+
+
+ {% if params.raw %}
+
+ {% endif %}
+ {% if params.template %}
+
+ {% endif %}
+ {% if params.scss %}
+
+ {% endif %}
+
+
Open this example in a new window
+
HTML
+ {% if params.raw %}
+
Nunjucks
+ {% endif %}
+ {% if params.template %}
+
Nunjucks Template
+ {% endif %}
+ {% if params.scss %}
+
SCSS
+ {% endif %}
+
+
+
+
+ {{ params.html }}
+
+
+ {%- if params.raw -%}
+
+ {% if params.options %}
+
+ Nunjucks macro options
+ {{ params.options | safe }}
+
+ {% endif %}
+
+ {{ params.raw }}
+
+
+ {%- endif -%}
+ {%- if params.template -%}
+
+
+ {{ params.template }}
+
+
+ {%- endif -%}
+ {%- if params.scss -%}
+
+
+ {{ params.scss }}
+
+
+ {%- endif -%}
+
+
+
{% endmacro %}
diff --git a/src/views/partials/example/_template.njk b/src/views/partials/example/_template.njk
deleted file mode 100644
index 983a582291..0000000000
--- a/src/views/partials/example/_template.njk
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
- {% if params.raw %}
-
- {% endif %}
- {% if params.template %}
-
- {% endif %}
- {% if params.scss %}
-
- {% endif %}
-
-
Open this example in a new window
-
HTML
- {% if params.raw %}
-
Nunjucks
- {% endif %}
- {% if params.template %}
-
Nunjucks Template
- {% endif %}
- {% if params.scss %}
-
SCSS
- {% endif %}
-
-
-
-
- {{ params.html }}
-
-
- {%- if params.raw -%}
-
- {% if params.options %}
-
- Nunjucks macro options
- {{ params.options | safe }}
-
- {% endif %}
-
- {{ params.raw }}
-
-
- {%- endif -%}
- {%- if params.template -%}
-
-
- {{ params.template }}
-
-
- {%- endif -%}
- {%- if params.scss -%}
-
-
- {{ params.scss }}
-
-
- {%- endif -%}
-
-
-
diff --git a/src/views/partials/sub-navigation/_macro.njk b/src/views/partials/sub-navigation/_macro.njk
index e9cb6f8392..c20534820f 100644
--- a/src/views/partials/sub-navigation/_macro.njk
+++ b/src/views/partials/sub-navigation/_macro.njk
@@ -1,3 +1,20 @@
{% macro patternlibSubNavigation(params) %}
- {% include "./_template.njk" %}
+
+
+ {% for item in params.items %}
+
+ {{ item.title }}
+ {% if item.anchors %}
+
+ {% endif %}
+
+ {% endfor %}
+
+
{% endmacro %}
diff --git a/src/views/partials/sub-navigation/_template.njk b/src/views/partials/sub-navigation/_template.njk
deleted file mode 100644
index dece818a57..0000000000
--- a/src/views/partials/sub-navigation/_template.njk
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
- {% for item in params.items %}
-
- {{ item.title }}
- {% if item.anchors %}
-
- {% endif %}
-
- {% endfor %}
-
-