Skip to content

Commit

Permalink
refactor: use absolute nunjucks import path
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lhokktyn authored and paulrobertlloyd committed Dec 27, 2024
1 parent 1fd42c7 commit fc0d0e0
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 fc0d0e0

Please sign in to comment.