Skip to content

Commit

Permalink
Use component directly
Browse files Browse the repository at this point in the history
- for the moment, include all components/JS
  • Loading branch information
KludgeKML committed Nov 14, 2024
1 parent 3a67919 commit 397188d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
3 changes: 3 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//= require govuk_publishing_components/dependencies
//= require govuk_publishing_components/lib
//= require govuk_publishing_components/components/error-summary
//= require govuk_publishing_components/components/radio
//= require govuk_publishing_components/components/feedback
//= require govuk_publishing_components/components/layout-super-navigation-header
2 changes: 2 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
// for components and views on pages where they are needed.

// https://github.com/alphagov/govuk_publishing_components/blob/main/docs/set-up-individual-component-css-loading.md

@import "govuk_publishing_components/all_components";
27 changes: 7 additions & 20 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,10 @@
<% end %>
<% end %>
<!DOCTYPE html>
<html>
<head>
<title><%= yield :title %> - GOV.UK</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<% if content_for(:meta_description).present? %>
<meta name="description" content="<%= content_for(:meta_description) %>" />
<% end %>
<%= yield :head %>
<meta name="robots" content="noindex, nofollow">
<%=
render_component_stylesheets
%>
</head>
<body class="govuk-template__body">
<%= yield :body %>
<%= javascript_include_tag 'application', type: "module" %>
</body>
</html>
<%= render "govuk_publishing_components/components/layout_for_public", {
title: yield(:title),
show_explore_header: true,
} do %>
<%= yield :body %>
<%= javascript_include_tag 'application', type: "module" %>
<% end %>
1 change: 1 addition & 0 deletions config/initializers/govuk_publishing_components.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
GovukPublishingComponents.configure do |c|
c.component_guide_title = "Email Alert Frontend Component Guide"
c.application_stylesheet = "application"
c.exclude_css_from_static = false
end

0 comments on commit 397188d

Please sign in to comment.