Skip to content

Commit

Permalink
Update Nunjucks component paths (#305)
Browse files Browse the repository at this point in the history
`node_modules/govuk-frontend/dist/components/` was missing `govuk/`
before `components/`, however we don't really need both the higher-level
and lower-level paths here. For greater consistency, just using the
higher-level path to enable a single clearly-namespaced route to each
GOV.UK and MOJ Nunjucks component makes more sense. The lower-level path
is often unused on projects that use this template

Imports should therefore look like this:

```njk
{% from "govuk/components/checkboxes/macro.njk" import govukCheckboxes %}
```

... and not this:

```njk
{% from "checkboxes/macro.njk" import govukCheckboxes %}
```
  • Loading branch information
yndajas authored Jan 31, 2024
1 parent 2afb131 commit b54a9f7
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions server/utils/nunjucksSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ export default function nunjucksSetup(app: express.Express, applicationInfo: App
[
path.join(__dirname, '../../server/views'),
'node_modules/govuk-frontend/dist/',
'node_modules/govuk-frontend/dist/components/',
'node_modules/@ministryofjustice/frontend/',
'node_modules/@ministryofjustice/frontend/moj/components/',
],
{
autoescape: true,
Expand Down

0 comments on commit b54a9f7

Please sign in to comment.