Skip to content

Commit

Permalink
Move head content into partial
Browse files Browse the repository at this point in the history
  • Loading branch information
martikat committed Jul 11, 2024
1 parent 06d3f25 commit 2e66ba6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 38 deletions.
24 changes: 24 additions & 0 deletions app/views/layouts/_head.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
title= [t('service.name'), yield(:page_title).presence].compact.join(' : ')

= csrf_meta_tags
= csp_meta_tag

= tag.meta content: 'text/html; charset=UTF-8', 'http-equiv': 'Content-Type'
= render 'layouts/analytics_header'
= render 'layouts/hotjar'

= tag.meta content: 'width=device-width,initial-scale=1', name: 'viewport'
= tag.meta name: 'robots', content: 'noindex,nofollow' unless Rails.application.live?
= tag.meta property: 'og:image', content: image_path('hfeyp_opengraph.png')
= tag.meta name: 'description', content: @page&.meta_description if @page&.meta_description.present?

= csrf_meta_tags
= tag.meta name: 'theme-color', content: '#0b0c0c'

= favicon_link_tag image_path('dfe_favicon.ico')

= stylesheet_link_tag 'application', 'data-turbo-track': 'reload'

= javascript_include_tag 'application', 'data-turbo-track': 'reload', defer: true

= yield :head
20 changes: 1 addition & 19 deletions app/views/layouts/application.html.slim
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
doctype html
html.govuk-template lang='en'
head
title= [t('service.name'), yield(:page_title).presence].compact.join(' : ')
= csrf_meta_tags
= csp_meta_tag

= tag.meta content: 'text/html; charset=UTF-8', 'http-equiv': 'Content-Type'
= render 'layouts/analytics_header'
= render 'layouts/hotjar'

= tag.meta content: 'width=device-width,initial-scale=1', name: 'viewport'
= tag.meta name: 'robots', content: 'noindex,nofollow' unless Rails.application.live?
= tag.meta property: 'og:image', content: image_path('hfeyp_opengraph.png')
= tag.meta name: 'description', content: @page&.meta_description if @page&.meta_description.present?
= csrf_meta_tags
= tag.meta name: 'theme-color', content: '#0b0c0c'

= favicon_link_tag image_path('dfe_favicon.ico')
= stylesheet_link_tag 'application', 'data-turbo-track': 'reload'
= javascript_include_tag 'application', 'data-turbo-track': 'reload', defer: true
= yield :head
= render 'layouts/head'

body#default-layout.govuk-template__body
script
Expand Down
20 changes: 1 addition & 19 deletions app/views/layouts/hero.html.slim
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
doctype html
html.govuk-template lang='en'
head
title= [t('service.name'), yield(:page_title).presence].compact.join(' : ')
= csrf_meta_tags
= csp_meta_tag

= tag.meta content: 'text/html; charset=UTF-8', 'http-equiv': 'Content-Type'
= render 'layouts/analytics_header'
= render 'layouts/hotjar'

= tag.meta content: 'width=device-width,initial-scale=1', name: 'viewport'
= tag.meta name: 'robots', content: 'noindex,nofollow' unless Rails.application.live?
= tag.meta property: 'og:image', content: image_path('hfeyp_opengraph.png')
= tag.meta name: 'description', content: @page&.meta_description if @page&.meta_description.present?
= csrf_meta_tags
= tag.meta name: 'theme-color', content: '#0b0c0c'

= favicon_link_tag image_path('dfe_favicon.ico')
= stylesheet_link_tag 'application', 'data-turbo-track': 'reload'
= javascript_include_tag 'application', 'data-turbo-track': 'reload', defer: true
= yield :head
= render 'layouts/head'

body#hero-layout.govuk-template__body
script
Expand Down

0 comments on commit 2e66ba6

Please sign in to comment.