Skip to content

Commit 9d7f3df

Browse files
Merge pull request #419 from alphagov/update-asset-path
2 parents 45e1a4d + f135f8c commit 9d7f3df

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Fixes
44

55
- [Update logo SVG in header](https://github.com/alphagov/tech-docs-gem/pull/418)
6+
- [Update path to GOV.UK Frontend assets when using GOV.UK logo](https://github.com/alphagov/tech-docs-gem/pull/419)
67

78
## 5.0.0
89

lib/govuk_tech_docs/meta_tags.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def canonical_url
4949

5050
def page_image
5151
if config[:tech_docs][:show_govuk_logo]
52-
"#{host}/assets/govuk/assets/images/govuk-opengraph-image.png"
52+
"#{host}/assets/govuk/assets/rebrand/images/govuk-opengraph-image.png"
5353
else
5454
"#{host}/images/opengraph-image.png"
5555
end

lib/source/layouts/core.erb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
'/'
2525
end
2626
%>
27-
<link rel="icon" sizes="48x48" href="<%= path_prefix %>assets/govuk/assets/images/favicon.ico">
28-
<link rel="icon" sizes="any" href="<%= path_prefix %>assets/govuk/assets/images/favicon.svg" type="image/svg+xml">
29-
<link rel="mask-icon" href="<%= path_prefix %>assets/govuk/assets/images/govuk-icon-mask.svg" color="#0b0c0c">
30-
<link rel="apple-touch-icon" href="<%= path_prefix %>assets/govuk/assets/images/govuk-icon-180.png">
31-
<link rel="manifest" href="<%= path_prefix %>assets/govuk/assets/manifest.json">
27+
<link rel="icon" sizes="48x48" href="<%= path_prefix %>assets/govuk/assets/rebrand/images/favicon.ico">
28+
<link rel="icon" sizes="any" href="<%= path_prefix %>assets/govuk/assets/rebrand/images/favicon.svg" type="image/svg+xml">
29+
<link rel="mask-icon" href="<%= path_prefix %>assets/govuk/assets/rebrand/images/govuk-icon-mask.svg" color="#0b0c0c">
30+
<link rel="apple-touch-icon" href="<%= path_prefix %>assets/govuk/assets/rebrand/images/govuk-icon-180.png">
31+
<link rel="manifest" href="<%= path_prefix %>assets/govuk/assets/rebrand/manifest.json">
3232
<% else %>
3333
<link rel="icon" sizes="48x48" href="/images/favicon.ico">
3434
<link rel="icon" sizes="any" href="/images/favicon.svg" type="image/svg+xml">

spec/features/integration_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,16 @@ def then_the_brand_refresh_is_enabled
151151
expect(page).to have_css ".govuk-logo-dot"
152152
# Check for crown svg in footer
153153
expect(page).to have_css ".govuk-footer__crown"
154+
# Check for favicons and other meta tags
155+
# <link rel="icon" sizes="48x48" href="<%= path_prefix %>assets/govuk/assets/rebrand/images/favicon.ico">
156+
expect(page).to have_css 'link[rel="icon"][sizes="48x48"][href$="assets/govuk/assets/rebrand/images/favicon.ico"]', visible: false
157+
# <link rel="icon" sizes="any" href="<%= path_prefix %>assets/govuk/assets/rebrand/images/favicon.svg" type="image/svg+xml">
158+
expect(page).to have_css 'link[rel="icon"][sizes="any"][type="image/svg+xml"][href$="assets/govuk/assets/rebrand/images/favicon.svg"]', visible: false
159+
# <link rel="mask-icon" href="<%= path_prefix %>assets/govuk/assets/rebrand/images/govuk-icon-mask.svg" color="#0b0c0c">
160+
expect(page).to have_css 'link[rel="mask-icon"][href$="assets/govuk/assets/rebrand/images/govuk-icon-mask.svg"][color="#0b0c0c"]', visible: false
161+
# <link rel="apple-touch-icon" href="<%= path_prefix %>assets/govuk/assets/rebrand/images/govuk-icon-180.png">
162+
expect(page).to have_css 'link[rel="apple-touch-icon"][href$="assets/govuk/assets/rebrand/images/govuk-icon-180.png"]', visible: false
163+
# <link rel="manifest" href="<%= path_prefix %>assets/govuk/assets/rebrand/manifest.json">
164+
expect(page).to have_css 'link[rel="manifest"][href$="assets/govuk/assets/rebrand/manifest.json"]', visible: false
154165
end
155166
end

spec/govuk_tech_docs/meta_tags_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def generate_title(site_name:, page_title:)
5151
"description" => "The description.",
5252
"twitter:card" => "summary",
5353
"twitter:domain" => "www.example.org",
54-
"twitter:image" => "https://www.example.org/assets/govuk/assets/images/govuk-opengraph-image.png",
54+
"twitter:image" => "https://www.example.org/assets/govuk/assets/rebrand/images/govuk-opengraph-image.png",
5555
"twitter:title" => "The Title - Test Site",
5656
"twitter:url" => "https://www.example.org/foo.html",
5757
)
@@ -166,7 +166,7 @@ def generate_title(site_name:, page_title:)
166166

167167
expect(og_tags).to eql(
168168
"og:description" => "The description.",
169-
"og:image" => "https://www.example.org/assets/govuk/assets/images/govuk-opengraph-image.png",
169+
"og:image" => "https://www.example.org/assets/govuk/assets/rebrand/images/govuk-opengraph-image.png",
170170
"og:site_name" => "Test Site",
171171
"og:title" => "The Title",
172172
"og:type" => "object",

0 commit comments

Comments
 (0)