Skip to content

Commit b3adc53

Browse files
authored
Merge pull request #391 from johnsgp/use-service-link-for-favicon
Use the service link as the start of the path to the favicon images
2 parents 5bc4d20 + 9ba3fc7 commit b3adc53

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
- [Fix: Update Rack::File to Rack::Files in test specs](https://github.com/alphagov/tech-docs-gem/pull/394)
66

7+
- [Fix: Use the service link as the start of the path to the favicon images](https://github.com/alphagov/tech-docs-gem/pull/391)
8+
79
## 4.2.0
810

911
## New features

lib/source/layouts/core.erb

+16-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,22 @@
1111

1212
<link rel="canonical" href="<%= meta_tags.canonical_url %>">
1313
<% if config[:tech_docs][:show_govuk_logo] %>
14-
<link rel="icon" sizes="48x48" href="/assets/govuk/assets/images/favicon.ico">
15-
<link rel="icon" sizes="any" href="/assets/govuk/assets/images/favicon.svg" type="image/svg+xml">
16-
<link rel="mask-icon" href="/assets/govuk/assets/images/govuk-icon-mask.svg" color="#0b0c0c">
17-
<link rel="apple-touch-icon" href="/assets/govuk/assets/images/govuk-icon-180.png">
18-
<link rel="manifest" href="/assets/govuk/assets/manifest.json">
14+
<%
15+
if development?
16+
path_prefix = '/'
17+
else
18+
path_prefix = config[:tech_docs][:service_link] || '/'
19+
# ensure service_link ends with a trailing '/'
20+
if path_prefix[-1, 1] != '/'
21+
path_prefix += '/'
22+
end
23+
end
24+
%>
25+
<link rel="icon" sizes="48x48" href="<%= path_prefix %>assets/govuk/assets/images/favicon.ico">
26+
<link rel="icon" sizes="any" href="<%= path_prefix %>assets/govuk/assets/images/favicon.svg" type="image/svg+xml">
27+
<link rel="mask-icon" href="<%= path_prefix %>assets/govuk/assets/images/govuk-icon-mask.svg" color="#0b0c0c">
28+
<link rel="apple-touch-icon" href="<%= path_prefix %>assets/govuk/assets/images/govuk-icon-180.png">
29+
<link rel="manifest" href="<%= path_prefix %>assets/govuk/assets/manifest.json">
1930
<% else %>
2031
<link rel="icon" sizes="48x48" href="/images/favicon.ico">
2132
<link rel="icon" sizes="any" href="/images/favicon.svg" type="image/svg+xml">

0 commit comments

Comments
 (0)