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

Move shared layout template includes to lib folder #1499

Closed
wants to merge 4 commits into from

Conversation

lfdebrux
Copy link
Member

@lfdebrux lfdebrux commented Aug 3, 2022

What

Move the contents of the app layout template includes that we would expect to be the same in every kit installation into the lib folder.

Why

Since the last release we have made a number of changes to the template partials in app/views/includes: in PR #1434 we removed the IE8 stylesheets; in PR #1478 we removed the jQuery script; and in PR #1481 we moved the common JavaScript into the lib folder and added a new script.

This file is in the user's space, but it would be nice if users didn't have to update it themselves. Moving the standard code out will also mean less is needed to bootstrap a prototype using a package.


This PR moves the standard lines in the template partials to new template partials in the lib folder, and replaces them with a placeholder comment illustrating how the user can customise their prototype if they wish.

We make sure that the lines in the kit templates are included first by inverting the control; by moving the lib folder first in the order of places to look for templates when the Nunjucks environment is configured we make sure that the files in the lib folder will be preferred, and then we include any app templates from the lib files.

This is similar to the method used in #1385 and #1481.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-move--phveyw August 3, 2022 08:24 Inactive
@lfdebrux lfdebrux added this to the v13 milestone Aug 3, 2022
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-move--phveyw August 3, 2022 08:30 Inactive
@lfdebrux lfdebrux changed the base branch from main to ldeb-move-js-to-lib August 3, 2022 08:39
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-move--phveyw August 3, 2022 08:40 Inactive
Base automatically changed from ldeb-move-js-to-lib to main August 3, 2022 09:33
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-move--phveyw August 3, 2022 09:34 Inactive
When running the kit as a package the lib folder will be in packageDir,
not projectDir.
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-move--phveyw August 3, 2022 10:09 Inactive
Copy link
Contributor

@BenSurgisonGDS BenSurgisonGDS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@BenSurgisonGDS BenSurgisonGDS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lfdebrux
Copy link
Member Author

Closing in favour of #1517

@lfdebrux lfdebrux closed this Aug 11, 2022
@lfdebrux lfdebrux deleted the ldeb-move-includes-to-lib branch August 16, 2022 10:32
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.

3 participants