Skip to content

Commit

Permalink
Improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Nov 13, 2020
1 parent 4347d9d commit 45d4242
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/helpers/title_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ def self.coder
end

def set_title(title = nil)
project_title = t("layouts.project_name.title")

if title
@title = TitleHelper.coder.decode(title.gsub("<bdi>", "\u202a").gsub("</bdi>", "\u202c"))
response.headers["X-Page-Title"] = ERB::Util.u("#{@title} | #{t('layouts.project_name.title')}")
response.headers["X-Page-Title"] = ERB::Util.u("#{@title} | #{project_title}")
else
@title = title
response.headers["X-Page-Title"] = ERB::Util.u(t("layouts.project_name.title"))
response.headers["X-Page-Title"] = ERB::Util.u(project_title)
end
end
end

0 comments on commit 45d4242

Please sign in to comment.