From f13dd8c8e1e18f73b5449847046ea289c544f4e7 Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Fri, 19 Apr 2024 06:58:45 +0800 Subject: [PATCH] Use blocks to define components --- src/_includes/global/baselayout.njk | 6 +++--- src/_includes/main/base.njk | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/_includes/global/baselayout.njk b/src/_includes/global/baselayout.njk index d982c4e0..01057689 100644 --- a/src/_includes/global/baselayout.njk +++ b/src/_includes/global/baselayout.njk @@ -25,12 +25,12 @@ {{ pageTitle }} - {% include "main/hero.njk" %} - {% include "main/navbar.njk" %} + {% block name %}{% include "global/hero.njk" %}{% endblock %} + {% block navbar %}{% include "global/navbar.njk" %}{% endblock %}
{{ content | safe }}
- {% include "main/footer.njk" %} + {% block footer %}{% include "global/footer.njk" %}{% endblock %} {% include "global/top-btn.njk" %} \ No newline at end of file diff --git a/src/_includes/main/base.njk b/src/_includes/main/base.njk index 66c807bd..16254589 100644 --- a/src/_includes/main/base.njk +++ b/src/_includes/main/base.njk @@ -1 +1,5 @@ -{% extends "global/baselayout.njk" %} \ No newline at end of file +{% extends "global/baselayout.njk" %} + +{% block name %}{% include "main/hero.njk" %}{% endblock %} +{% block navbar %}{% include "main/navbar.njk" %}{% endblock %} +{% block footer %}{% include "main/footer.njk" %}{% endblock %} \ No newline at end of file