From fc0d0e0c70d54dfff62b6d2e4aab20906224a000 Mon Sep 17 00:00:00 2001 From: lhokktyn <810615+lhokktyn@users.noreply.github.com> Date: Fri, 29 Nov 2024 08:39:37 +0000 Subject: [PATCH] refactor: use absolute nunjucks import path The "header" component macro currently imports the "site-search" macro using a relative URL. This prevents customisation of the "site-search" macro using the Nunjucks import prioritisation logic. Bringing this import inline with other import syntax across the plugin fixes this issue. For example, a consuming 11ty app wants to override the site-search macro, so can now create a "_includes/components/site-search/macro.njk" template to do that. --- components/header/template.njk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/header/template.njk b/components/header/template.njk index 4ca77dd..3ee4f28 100644 --- a/components/header/template.njk +++ b/components/header/template.njk @@ -1,4 +1,4 @@ -{%- from "../site-search/macro.njk" import appSiteSearch -%} +{%- from "components/site-search/macro.njk" import appSiteSearch -%} {%- if options.navigation -%} {%- set headerClasses = " govuk-header--full-width-border" -%} {% elif layout == "product" or layout == "collection" %}