From 8c2cfeacb50a0129a72d1d5357f3d1db300c9861 Mon Sep 17 00:00:00 2001 From: John Green Date: Wed, 23 Apr 2025 18:11:05 +0100 Subject: [PATCH 1/5] Use the service link as the start of the path to the images --- lib/source/layouts/core.erb | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/source/layouts/core.erb b/lib/source/layouts/core.erb index 21ba63ac..391c70f8 100644 --- a/lib/source/layouts/core.erb +++ b/lib/source/layouts/core.erb @@ -11,11 +11,18 @@ <% if config[:tech_docs][:show_govuk_logo] %> - - - - - + <% + service_link = config[:tech_docs][:service_link] || '/' + # ensure service_link ends with a trailing '/' + if service_link[-1, 1] != '/' + service_link += '/' + end + %> + + + + + <% else %> From a3d3c24fa06626b0672a5376c0cc44409ea65f8e Mon Sep 17 00:00:00 2001 From: John Green Date: Fri, 25 Apr 2025 13:31:44 +0100 Subject: [PATCH 2/5] Changelog entry for PR 391 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1173f31d..4c252cf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ - [Fix: Update Rack::File to Rack::Files in test specs](https://github.com/alphagov/tech-docs-gem/pull/394) +- [Fix: Use the service link as the start of the path to the favicon images](https://github.com/alphagov/tech-docs-gem/pull/391) + ## 4.2.0 ## New features From 978e6ff3561584078d4486a940dd6c27429e7080 Mon Sep 17 00:00:00 2001 From: John Green Date: Fri, 25 Apr 2025 16:13:46 +0100 Subject: [PATCH 3/5] Incorrectly applied the change to manifest.json --- lib/source/layouts/core.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/source/layouts/core.erb b/lib/source/layouts/core.erb index 391c70f8..278c59eb 100644 --- a/lib/source/layouts/core.erb +++ b/lib/source/layouts/core.erb @@ -22,7 +22,7 @@ - + <% else %> From 8d06b48443b6ab422a46b6d6d2995869e584c4e7 Mon Sep 17 00:00:00 2001 From: John Green Date: Fri, 25 Apr 2025 16:22:29 +0100 Subject: [PATCH 4/5] Fixed link to manifest.json --- lib/source/layouts/core.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/source/layouts/core.erb b/lib/source/layouts/core.erb index 278c59eb..0107624e 100644 --- a/lib/source/layouts/core.erb +++ b/lib/source/layouts/core.erb @@ -22,7 +22,7 @@ - + <% else %> From 9ba3fc7a85a6897aa9e22c2f0c5161fa5c02f7a3 Mon Sep 17 00:00:00 2001 From: John Green Date: Mon, 28 Apr 2025 08:15:52 +0100 Subject: [PATCH 5/5] Do not use the service_link for the Development environment --- lib/source/layouts/core.erb | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/source/layouts/core.erb b/lib/source/layouts/core.erb index 0107624e..d8931f91 100644 --- a/lib/source/layouts/core.erb +++ b/lib/source/layouts/core.erb @@ -12,17 +12,21 @@ <% if config[:tech_docs][:show_govuk_logo] %> <% - service_link = config[:tech_docs][:service_link] || '/' - # ensure service_link ends with a trailing '/' - if service_link[-1, 1] != '/' - service_link += '/' + if development? + path_prefix = '/' + else + path_prefix = config[:tech_docs][:service_link] || '/' + # ensure service_link ends with a trailing '/' + if path_prefix[-1, 1] != '/' + path_prefix += '/' + end end %> - - - - - + + + + + <% else %>