From 8f2aa43735520c312e9d756b393db11998d627fa Mon Sep 17 00:00:00 2001 From: Nick Colley Date: Thu, 24 May 2018 11:56:10 +0100 Subject: [PATCH] Add Boilerplate template Changes from [govuk_template](https://github.com/alphagov/govuk_template): Breaking changes: - Removed stylesheets relating to `govuk_template.css`, we now recommend people bundle stylesheets in their application. - Removed stylesheets relating to `print`, we do this at a component level. - Removed stylesheets relating to `font`, we now have a [new font loading strategy](https://github.com/alphagov/govuk-frontend/pull/726) that does not require a different bundle. - Removed `ie8` specific class being added to the `html` element, since we don't require functionality - Remove `ie.js`, used to shim HTML5 files, add JSON2 support, we now recommend people bundle in their application. - Removed functionality to remove `js-enabled` class if `window.GOVUK` is not defined, at the moment we can't guarantee that this global will be set with GOV.UK Frontend. See https://github.com/alphagov/govuk_template/pull/248 for details on this feature. Features: - Added a main block, now skip link works by default, this block can be overridden. Patch: - Moved Skip link into it's own block, calling the [Skip link component](https://github.com/alphagov/govuk-frontend/tree/master/src/components/skip-link) by default instead of being inlined. - Moved footer into it's own block, calling the [Footer component](https://github.com/alphagov/govuk-frontend/tree/master/src/components/footer) by default instead of being inlined. - Moved header into it's own block, calling the [Header component](https://github.com/alphagov/govuk-frontend/tree/master/src/components/header) by default instead of being inlined. - Changed the default `main` `id` to be `#main-content` to avoid being [styled by GOV.UK Elements](https://github.com/alphagov/govuk_elements/blob/8216538c1d2efb8b33372a22f28e1ea81d879ecd/assets/sass/elements/_layout.scss#L9). --- app/app.js | 3 +- app/views/examples/template/index.njk | 67 ++++++++++++++++++ app/views/layouts/_generic.njk | 40 +++++------ app/views/layouts/component-preview.njk | 7 +- app/views/layouts/full-width.njk | 4 ++ app/views/layouts/layout.njk | 6 -- src/assets/images/favicon.ico | Bin 0 -> 4598 bytes .../images/govuk-apple-touch-icon-152x152.png | Bin 0 -> 2862 bytes .../images/govuk-apple-touch-icon-167x167.png | Bin 0 -> 4230 bytes .../images/govuk-apple-touch-icon-180x180.png | Bin 0 -> 3503 bytes src/assets/images/govuk-apple-touch-icon.png | Bin 0 -> 2875 bytes src/assets/images/govuk-mask-icon.svg | 7 ++ src/assets/images/govuk-opengraph-image.png | Bin 0 -> 15380 bytes src/template.njk | 58 +++++++++++++++ 14 files changed, 161 insertions(+), 31 deletions(-) create mode 100644 app/views/examples/template/index.njk create mode 100644 src/assets/images/favicon.ico create mode 100755 src/assets/images/govuk-apple-touch-icon-152x152.png create mode 100755 src/assets/images/govuk-apple-touch-icon-167x167.png create mode 100755 src/assets/images/govuk-apple-touch-icon-180x180.png create mode 100755 src/assets/images/govuk-apple-touch-icon.png create mode 100644 src/assets/images/govuk-mask-icon.svg create mode 100644 src/assets/images/govuk-opengraph-image.png create mode 100644 src/template.njk diff --git a/app/app.js b/app/app.js index f0c4a73eba..552fd1581c 100644 --- a/app/app.js +++ b/app/app.js @@ -17,7 +17,8 @@ const appViews = [ configPaths.layouts, configPaths.partials, configPaths.examples, - configPaths.components + configPaths.components, + configPaths.src ] module.exports = (options) => { diff --git a/app/views/examples/template/index.njk b/app/views/examples/template/index.njk new file mode 100644 index 0000000000..e47d29e60b --- /dev/null +++ b/app/views/examples/template/index.njk @@ -0,0 +1,67 @@ +{% extends "template.njk" %} + +{% set assetPath = '/assets/' %} + +{% block head %} + + + + +{% endblock %} + +{% from "back-link/macro.njk" import govukBackLink %} +{% from "date-input/macro.njk" import govukDateInput %} +{% from "button/macro.njk" import govukButton %} + +{% block content %} + {{ govukBackLink({ + "text": "Back" + }) }} + +
+
+
+
+ + {{ govukDateInput({ + id: 'dob', + name: 'dob', + fieldset: { + legend: { + text: 'What is your date of birth?', + isPageHeading: true, + classes: 'govuk-fieldset__legend--xl' + } + }, + hint: { + text: 'For example, 31 3 1980' + }, + items:[ + { + name: 'day' + }, + { + name: 'month' + }, + { + name: 'year' + } + ] + }) + }} + + {{ govukButton({ + "text": "Continue" + }) }} +
+ +
+
+
+{% endblock %} + +{% block bodyEnd %} + +{% endblock %} diff --git a/app/views/layouts/_generic.njk b/app/views/layouts/_generic.njk index 59a8519de4..4c965046cd 100644 --- a/app/views/layouts/_generic.njk +++ b/app/views/layouts/_generic.njk @@ -1,29 +1,27 @@ - - - - +{% extends "template.njk" %} + +{% set pageTitle = "GOV.UK Frontend" %} + +{% block head %} - GOV.UK Frontend - + - - {% block styles %} - {% endblock %} - - - - {% block body %} - {% block content %}{% endblock %} - {% endblock %} + + {% block styles %}{% endblock %} +{% endblock %} + +{# Turn the header and footer off #} +{% block header %}{% endblock %} +{% block footer %}{% endblock %} + +{% block bodyEnd %}