Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct separator for page titles #176

Merged
merged 1 commit into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/govuk_tech_docs/meta_tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def tags
end

def browser_title
[page_title, site_name].select(&:present?).uniq.join(" | ")
[page_title, site_name].select(&:present?).uniq.join(" - ")
end

def canonical_url
Expand Down
2 changes: 1 addition & 1 deletion spec/features/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def then_there_is_a_sidebar
end

def and_there_are_proper_meta_tags
expect(page).to have_title "GOV.UK Documentation Example | My First Service"
expect(page).to have_title "GOV.UK Documentation Example - My First Service"
expect(page).to have_css 'meta[property="og:site_name"]', visible: false
end

Expand Down
4 changes: 2 additions & 2 deletions spec/govuk_tech_docs/meta_tags_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
it "combines the page title and service name" do
browser_title = generate_title(site_name: "Test Site", page_title: "The Title")

expect(browser_title).to eql("The Title | Test Site")
expect(browser_title).to eql("The Title - Test Site")
end

it "does not duplicate the page title" do
Expand Down Expand Up @@ -56,7 +56,7 @@ def generate_title(site_name:, page_title:)
"twitter:card" => "summary",
"twitter:domain" => "www.example.org",
"twitter:image" => "https://www.example.org/images/govuk-large.png",
"twitter:title" => "The Title | Test Site",
"twitter:title" => "The Title - Test Site",
"twitter:url" => "https://www.example.org/foo.html")
end

Expand Down