Skip to content

Commit

Permalink
Use absolute Nunjucks import path
Browse files Browse the repository at this point in the history
The appHeader component macro currently imports the appSiteSearch macro
using a relative URL. This prevents customisation of the appSiteSearch
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 appSiteSearch macro,
so can now create a "_includes/components/site-search/macro.njk" template
to do that.
  • Loading branch information
lhokktyn authored and paulrobertlloyd committed Dec 27, 2024
1 parent 1fd42c7 commit 70242dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/header/template.njk
Original file line number Diff line number Diff line change
@@ -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" %}
Expand Down

0 comments on commit 70242dc

Please sign in to comment.