Browse Source

Un-anger the cop

pull/390/head
baarkerlounger 3 years ago
parent
commit
987158b7f4
  1. 8
      app/helpers/content_helper.rb
  2. 6
      app/views/content/page.html.erb

8
app/helpers/content_helper.rb

@ -3,12 +3,12 @@ module ContentHelper
raw_content = File.read("app/views/content/#{page_name}.md")
content_with_erb_tags_replaced = ApplicationController.renderer.render(
inline: raw_content,
locals: locals
locals:,
)
@page_title = page_title || page_name.to_s.humanize
@page_content = GovukMarkdown.render(content_with_erb_tags_replaced).html_safe
page_title ||= page_name.to_s.humanize
page_content = GovukMarkdown.render(content_with_erb_tags_replaced).html_safe
render "content/page"
render "content/page", locals: { page_title:, page_content: }
end
end

6
app/views/content/page.html.erb

@ -1,9 +1,9 @@
<%= content_for :title, @page_title %>
<%= content_for :title, page_title %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds-from-desktop">
<h1 class="govuk-heading-xl"><%= @page_title %></h1>
<h1 class="govuk-heading-xl"><%= page_title %></h1>
<%= @page_content %>
<%= page_content %>
</div>
</div>

Loading…
Cancel
Save