Move site layout macro back to layout page template

This commit is contained in:
Helen Chong 2024-04-18 23:47:17 +08:00
parent 898f912004
commit 6363de3b49
2 changed files with 10 additions and 11 deletions

View File

@ -1,6 +0,0 @@
{%- macro siteLayoutArchive(params) -%}
<h2>{{ params.title }}</h2>
{% for screenshot in params.screenshots %}
<img src="/assets/layouts/{{ screenshot.imgFile }}" alt="{{ screenshot.imgAlt }}">
{% endfor %}
{%- endmacro -%}

View File

@ -9,9 +9,14 @@ eleventyNavigation:
order: 1 order: 1
--- ---
{%- from "macros/components.njk" import siteLayoutArchive -%} {%- macro siteLayout(params) -%}
<h2>{{ params.title }}</h2>
{% for screenshot in params.screenshots %}
<img src="/assets/layouts/{{ screenshot.imgFile }}" alt="{{ screenshot.imgAlt }}">
{% endfor %}
{%- endmacro -%}
{{ siteLayoutArchive({ {{ siteLayout({
title: "11 September 2023 Blog Layout", title: "11 September 2023 Blog Layout",
screenshots: [ screenshots: [
{ {
@ -21,7 +26,7 @@ eleventyNavigation:
] ]
}) }} }) }}
{{ siteLayoutArchive({ {{ siteLayout({
title: "23 June 2023", title: "23 June 2023",
screenshots: [ screenshots: [
{ {
@ -31,7 +36,7 @@ eleventyNavigation:
] ]
}) }} }) }}
{{ siteLayoutArchive({ {{ siteLayout({
title: "26 January 2023", title: "26 January 2023",
screenshots: [ screenshots: [
{ {
@ -41,7 +46,7 @@ eleventyNavigation:
] ]
}) }} }) }}
{{ siteLayoutArchive({ {{ siteLayout({
title: "11 September 2022 (Site Launch)", title: "11 September 2022 (Site Launch)",
screenshots: [ screenshots: [
{ {