Skip to content

Commit

Permalink
Merge branch 'main' into feature/add-example-pattern-for-documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
precious-onyenaucheya-ons authored Oct 16, 2023
2 parents 487ad9a + 0f23239 commit 32fc8a1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 42 deletions.
36 changes: 12 additions & 24 deletions __snapshots__/layout/_template.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ exports[`base page template matches the body block override snapshot 1`] = `
<script>document.body.className = ((document.body.className) ? document.body.className + ' ons-js-enabled' : 'ons-js-enabled');</script>

Content


<script>
(function() {
Expand All @@ -72,6 +73,7 @@ exports[`base page template matches the body block override snapshot 1`] = `




</body></html>"
`;

Expand Down Expand Up @@ -119,7 +121,6 @@ exports[`base page template matches the favicons block override snapshot 1`] = `
<div class="ons-page__content">





<a class="ons-skip-to-content" href="#main-content">Skip to main content</a>
Expand Down Expand Up @@ -271,15 +272,13 @@ exports[`base page template matches the favicons block override snapshot 1`] = `
</div>
</div>



</div>




</div>



<script>
Expand All @@ -305,6 +304,7 @@ exports[`base page template matches the favicons block override snapshot 1`] = `




</body></html>"
`;

Expand Down Expand Up @@ -360,7 +360,6 @@ exports[`base page template matches the footer block override snapshot 1`] = `
<div class="ons-page__content">





<a class="ons-skip-to-content" href="#main-content">Skip to main content</a>
Expand Down Expand Up @@ -512,13 +511,11 @@ exports[`base page template matches the footer block override snapshot 1`] = `
</div>
</div>



</div>


</div>



<script>
Expand All @@ -544,6 +541,7 @@ exports[`base page template matches the footer block override snapshot 1`] = `




</body></html>"
`;

Expand Down Expand Up @@ -622,9 +620,6 @@ exports[`base page template matches the full configuration snapshot 1`] = `

<div class="ons-page">
<div class="ons-page__content">

<form class="form-class" method="POST" autocomplete="off" novalidate="null">

Some preHeader content


Expand Down Expand Up @@ -1314,10 +1309,6 @@ exports[`base page template matches the full configuration snapshot 1`] = `
</div>
</div>



</form>

</div>
Some preFooter content

Expand Down Expand Up @@ -1761,8 +1752,8 @@ exports[`base page template matches the full configuration snapshot 1`] = `


</div>
Some bodyEnd content

Some bodyEnd content

<script>
(function() {
Expand All @@ -1787,6 +1778,7 @@ exports[`base page template matches the full configuration snapshot 1`] = `

<script src="random-script.js"></script>


</body></html>"
`;

Expand Down Expand Up @@ -1840,7 +1832,6 @@ exports[`base page template matches the meta block override snapshot 1`] = `
<div class="ons-page__content">





<a class="ons-skip-to-content" href="#main-content">Skip to main content</a>
Expand Down Expand Up @@ -1992,15 +1983,13 @@ exports[`base page template matches the meta block override snapshot 1`] = `
</div>
</div>



</div>




</div>



<script>
Expand All @@ -2026,6 +2015,7 @@ exports[`base page template matches the meta block override snapshot 1`] = `




</body></html>"
`;

Expand Down Expand Up @@ -2065,7 +2055,6 @@ exports[`base page template matches the social block override snapshot 1`] = `
<div class="ons-page__content">





<a class="ons-skip-to-content" href="#main-content">Skip to main content</a>
Expand Down Expand Up @@ -2217,15 +2206,13 @@ exports[`base page template matches the social block override snapshot 1`] = `
</div>
</div>



</div>




</div>



<script>
Expand All @@ -2251,5 +2238,6 @@ exports[`base page template matches the social block override snapshot 1`] = `




</body></html>"
`;
25 changes: 7 additions & 18 deletions src/layout/_template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,14 @@
{% block body %}
<div class="ons-page">
<div class="ons-page__content">
{% if form and form.attributes %}
<form
{% if form.classes %}class="{{ form.classes }}"{% endif %}
method="{{ form.method | default('POST') }}"
{% if form.attributes %}{% for attribute, value in (form.attributes.items() if form.attributes is mapping and form.attributes.items else form.attributes) %}{{ attribute }}{% if value %}="{{value}}" {% endif %}{% endfor %}{% endif %}
>
{% endif %}
{% block preHeader %}{% endblock %}
{% block skipLink %}
{{
onsSkipToContent({
"url": "#main-content",
"text": "Skip to main content"
})
}}
onsSkipToContent({
"url": "#main-content",
"text": "Skip to main content"
})
}}
{% endblock %}
{% block header %}
{{
Expand Down Expand Up @@ -192,10 +185,6 @@
</div>
</div>
{% endblock %}

{% if form and form.attributes %}
</form>
{% endif %}
</div>
{% block preFooter %}{% endblock %}
{% block footer %}
Expand All @@ -222,8 +211,8 @@
{% endif %}
{% endblock %}
</div>
{% block bodyEnd %}{% endblock %}
{% endblock %}
{% block bodyEnd %}{% endblock %}

<script{% if pageConfig.cspNonce %} nonce="{{ pageConfig.cspNonce }}"{% elif pageConfig.cspNonce is not defined and csp_nonce %} nonce="{{ csp_nonce() }}"{% endif %}>
(function() {
Expand All @@ -248,4 +237,4 @@

{% block scripts %}{% endblock %}
</body>
</html>
</html>

0 comments on commit 32fc8a1

Please sign in to comment.