Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use absolute nunjucks import path #355

Merged
merged 1 commit into from
Dec 27, 2024

Conversation

lhokktyn
Copy link
Contributor

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.

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.
@lhokktyn
Copy link
Contributor Author

@paulrobertlloyd this is related to the recent change of nunjucks priority ordering in #354. As far as I could see, this was the only place relative URLs were used to import, but so happens to be the macro Id like to override :)

@paulrobertlloyd paulrobertlloyd merged commit fc0d0e0 into x-govuk:main Dec 27, 2024
2 checks passed
@paulrobertlloyd
Copy link
Collaborator

Am slightly concerned that the ‘components’ import path may be too broad, but we can cross that bridge should we come to it.

@paulrobertlloyd
Copy link
Collaborator

Fixed and released in v6.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants