-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(prototype kit integration): users of prototype-kit-v13 should ha…
…ve macros and filters available (#378) In version 13 of GOV.UK Prototype Kit we have some new integration points. This makes use of the new integration points and makes the installation simpler for users. Specifically, for moj-frontend, this will import all the nunjucks macros (components) and filters without the user having to do any setup themselves.
- Loading branch information
1 parent
72220a4
commit 89cbf0a
Showing
2 changed files
with
93 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,87 @@ | ||
{ | ||
"nunjucksPaths": ["/"], | ||
"scripts": ["/moj/all.js"], | ||
"assets": ["/moj/assets"], | ||
"sass": ["/moj/all.scss"] | ||
"nunjucksFilters": [ | ||
"/moj/filters/prototype-kit-13-filters.js" | ||
], | ||
"scripts": [ | ||
"/moj/all.js" | ||
], | ||
"assets": [ | ||
"/moj/assets" | ||
], | ||
"sass": [ | ||
"/moj/all.scss" | ||
], | ||
"nunjucksPaths": [ | ||
"/" | ||
], | ||
"nunjucksMacros": [ | ||
{ | ||
"importFrom": "moj/components/side-navigation/macro.njk", | ||
"macroName": "mojSideNavigation" | ||
}, | ||
{ | ||
"importFrom": "moj/components/organisation-switcher/macro.njk", | ||
"macroName": "mojOrganisationSwitcher" | ||
}, | ||
{ | ||
"importFrom": "moj/components/primary-navigation/macro.njk", | ||
"macroName": "mojPrimaryNavigation" | ||
}, | ||
{ | ||
"importFrom": "moj/components/identity-bar/macro.njk", | ||
"macroName": "mojIdentityBar" | ||
}, | ||
{ | ||
"importFrom": "moj/components/sub-navigation/macro.njk", | ||
"macroName": "mojSubNavigation" | ||
}, | ||
{ | ||
"importFrom": "moj/components/notification-badge/macro.njk", | ||
"macroName": "mojNotificationBadge" | ||
}, | ||
{ | ||
"importFrom": "moj/components/ticket-panel/macro.njk", | ||
"macroName": "mojTicketPanel" | ||
}, | ||
{ | ||
"importFrom": "moj/components/timeline/macro.njk", | ||
"macroName": "mojTimeline" | ||
}, | ||
{ | ||
"importFrom": "moj/components/badge/macro.njk", | ||
"macroName": "mojBadge" | ||
}, | ||
{ | ||
"importFrom": "moj/components/messages/macro.njk", | ||
"macroName": "mojMessages" | ||
}, | ||
{ | ||
"importFrom": "moj/components/banner/macro.njk", | ||
"macroName": "mojBanner" | ||
}, | ||
{ | ||
"importFrom": "moj/components/pagination/macro.njk", | ||
"macroName": "mojPagination" | ||
}, | ||
{ | ||
"importFrom": "moj/components/filter/macro.njk", | ||
"macroName": "mojFilter" | ||
}, | ||
{ | ||
"importFrom": "moj/components/button-menu/macro.njk", | ||
"macroName": "mojButtonMenu" | ||
}, | ||
{ | ||
"importFrom": "moj/components/page-header-actions/macro.njk", | ||
"macroName": "mojPageHeaderActions" | ||
}, | ||
{ | ||
"importFrom": "moj/components/search/macro.njk", | ||
"macroName": "mojSearch" | ||
}, | ||
{ | ||
"importFrom": "moj/components/header/macro.njk", | ||
"macroName": "mojHeader" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const { addFilter } = require('govuk-prototype-kit').views | ||
const getAllFilters = require('./all') | ||
|
||
const allFilters = getAllFilters() | ||
|
||
Object.keys(allFilters).forEach(name => { | ||
addFilter(name, allFilters[name]) | ||
}) |