dont use unless and else, per rubocop
This commit is contained in:
parent
245abc6032
commit
fb7a346b48
|
@ -183,10 +183,10 @@ module Jekyll
|
|||
|
||||
def canonical_url
|
||||
@canonical_url ||= begin
|
||||
unless page["canonical_url"].to_s.empty?
|
||||
page["canonical_url"]
|
||||
else
|
||||
if page["canonical_url"].to_s.empty?
|
||||
filters.absolute_url(page["url"]).to_s.gsub(%r!/index\.html$!, "/")
|
||||
else
|
||||
page["canonical_url"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -638,7 +638,6 @@ RSpec.describe Jekyll::SeoTag::Drop do
|
|||
end
|
||||
|
||||
context "when canonical url is not specified for a page" do
|
||||
|
||||
it "uses site specific canonical url" do
|
||||
expect(subject.canonical_url).to eq("http://example.com/page.html")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue