hof 23.0.0-frontend-v4-beta.7 → 23.0.0-frontend-v4-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,10 +12,14 @@ module.exports = config => {
12
12
  }
13
13
  const srcs = Array.isArray(config.images.src) ? config.images.src : [config.images.src];
14
14
 
15
- return Promise.all(srcs.map(src =>
16
- mkdir(config.images.out)
17
- .then(() => spawn('rsync', ['-a', `${src}/.`, config.images.out]))
18
- ))
15
+ return Promise.all(srcs.map(src => {
16
+ if (!fs.existsSync(src)) {
17
+ console.log(`${chalk.yellow('warning')}: Skipping missing images folder: ${src}`);
18
+ return Promise.resolve();
19
+ }
20
+ return mkdir(config.images.out)
21
+ .then(() => spawn('rsync', ['-a', `${src}/.`, config.images.out]));
22
+ }))
19
23
  .catch(e => {
20
24
  if (e.code !== 'ENOENT') {
21
25
  throw e;
@@ -27,7 +27,7 @@ module.exports = {
27
27
  match: 'apps/**/translations/src/**/*.json',
28
28
  shared: 'apps/common/translations/src'
29
29
  },
30
- images: {
30
+ images: {
31
31
  src: ['assets/rebrand/images', toolkitImages],
32
32
  out: 'public/images',
33
33
  match: ['assets/rebrand/images/**/*', `${toolkitImages}/**/*`],
@@ -3,6 +3,7 @@
3
3
  module.exports = {
4
4
  htmlLang: '{{htmlLang}}',
5
5
  assetPath: '{{govukAssetPath}}',
6
+ assetRebrandPath: '{{govukAssetPath}}rebrand/',
6
7
  afterHeader: '{{$afterHeader}}{{/afterHeader}}',
7
8
  bodyClasses: '{{$bodyClasses}}{{/bodyClasses}}',
8
9
  bodyStart: '{{$bodyStart}}{{/bodyStart}}',
@@ -9,12 +9,12 @@
9
9
 
10
10
  <meta name="theme-color" content="#1d70b8">
11
11
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
12
- <link rel="icon" sizes="48x48" href="{{assetPath}}images/favicon.ico">
13
- <link rel="icon" sizes="any" href="{{assetPath}}images/favicon.svg" type="image/svg+xml">
14
- <link rel="mask-icon" href="{{assetPath}}images/govuk-icon-mask.svg" color="#1d70b8">
15
- <link rel="apple-touch-icon" href="{{assetPath}}images/govuk-icon-180.png">
16
- <link rel="manifest" href="{{assetPath}}manifest.json">
17
- <meta property="og:image" content="{{assetPath}}images/govuk-opengraph-image.png">
12
+ <link rel="icon" sizes="48x48" href="{{assetRebrandPath}}images/favicon.ico">
13
+ <link rel="icon" sizes="any" href="{{assetRebrandPath}}images/favicon.svg" type="image/svg+xml">
14
+ <link rel="mask-icon" href="{{assetRebrandPath}}images/govuk-icon-mask.svg" color="#1d70b8">
15
+ <link rel="apple-touch-icon" href="{{assetRebrandPath}}images/govuk-icon-180.png">
16
+ <link rel="manifest" href="{{assetRebrandPath}}manifest.json">
17
+ <meta property="og:image" content="{{assetRebrandPath}}images/govuk-opengraph-image.png">
18
18
  </head>
19
19
 
20
20
  <body class="{{ bodyClasses }} govuk-template__body js-enabled" >
@@ -35,10 +35,9 @@
35
35
  <!--[if gt IE 8]><!-->
36
36
  <div id="govuk-header__logo"></div>
37
37
  <img src="/public/images/govuk-logo-opt.svg" id="govuk-header__logo" alt="Logo" loading="lazy" />
38
- <!-- <img src="/assets/images/gov-uk-logo-opt" class="govuk-header__logotype-crown-fallback-image" width="32" height="30" alt=""> -->
39
38
  <!--<![endif]-->
40
39
  <!--[if IE 8]>
41
- <img src="{{ assetPath }}images/govuk-logotype-tudor-crown.png" class="govuk-header__logotype-crown-fallback-image" width="32" height="30" alt="">
40
+ <img src="{{ assetRebrandPath }}images/govuk-logotype-tudor-crown.png" class="govuk-header__logotype-crown-fallback-image" width="32" height="30" alt="">
42
41
  <![endif]-->
43
42
  </a>
44
43
  </div>
@@ -9,12 +9,12 @@
9
9
 
10
10
  <meta name="theme-color" content="#1d70b8">
11
11
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
12
- <link rel="icon" sizes="48x48" href="{{govukAssetPath}}images/favicon.ico">
13
- <link rel="icon" sizes="any" href="{{govukAssetPath}}images/favicon.svg" type="image/svg+xml">
14
- <link rel="mask-icon" href="{{govukAssetPath}}images/govuk-icon-mask.svg" color="#1d70b8">
15
- <link rel="apple-touch-icon" href="{{govukAssetPath}}images/govuk-icon-180.png">
16
- <link rel="manifest" href="{{govukAssetPath}}manifest.json">
17
- <meta property="og:image" content="{{govukAssetPath}}images/govuk-opengraph-image.png">
12
+ <link rel="icon" sizes="48x48" href="{{govukAssetPath}}rebrand/images/favicon.ico">
13
+ <link rel="icon" sizes="any" href="{{govukAssetPath}}rebrand/images/favicon.svg" type="image/svg+xml">
14
+ <link rel="mask-icon" href="{{govukAssetPath}}rebrand/images/govuk-icon-mask.svg" color="#1d70b8">
15
+ <link rel="apple-touch-icon" href="{{govukAssetPath}}rebrand/images/govuk-icon-180.png">
16
+ <link rel="manifest" href="{{govukAssetPath}}rebrand/manifest.json">
17
+ <meta property="og:image" content="{{govukAssetPath}}rebrand/images/govuk-opengraph-image.png">
18
18
  </head>
19
19
 
20
20
  <body class="{{$bodyClasses}}{{/bodyClasses}} govuk-template__body js-enabled" >
@@ -35,10 +35,9 @@
35
35
  <!--[if gt IE 8]><!-->
36
36
  <div id="govuk-header__logo"></div>
37
37
  <img src="/public/images/govuk-logo-opt.svg" id="govuk-header__logo" alt="Logo" loading="lazy" />
38
- <!-- <img src="/assets/images/gov-uk-logo-opt" class="govuk-header__logotype-crown-fallback-image" width="32" height="30" alt=""> -->
39
38
  <!--<![endif]-->
40
39
  <!--[if IE 8]>
41
- <img src="{{govukAssetPath}}images/govuk-logotype-tudor-crown.png" class="govuk-header__logotype-crown-fallback-image" width="32" height="30" alt="">
40
+ <img src="{{govukAssetPath}}rebrand/images/govuk-logotype-tudor-crown.png" class="govuk-header__logotype-crown-fallback-image" width="32" height="30" alt="">
42
41
  <![endif]-->
43
42
  </a>
44
43
  </div>
package/index.js CHANGED
@@ -238,7 +238,7 @@ function bootstrap(options) {
238
238
  app.use(hofMiddleware.rateLimiter(config, 'requests'));
239
239
  }
240
240
 
241
- // Set up routing so <YOUR-SITE-URL>/assets are served from /node_modules/govuk-frontend/govuk/assets
241
+ // Set up routing so <YOUR-SITE-URL>/assets are served from /node_modules/govuk-frontend/govuk/assets/rebrand
242
242
  app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/govuk/assets/rebrand')));
243
243
  // Check if service has been paused and redirect accordingly
244
244
  const bypassPaths = ['/assets', '/healthcheck', '/service-unavailable'];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hof",
3
3
  "description": "A bootstrap for HOF projects",
4
- "version": "23.0.0-frontend-v4-beta.7",
4
+ "version": "23.0.0-frontend-v4-beta.9",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
7
7
  "author": "HomeOffice",