Skip to content

Commit

Permalink
chomp index.html from first url
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman committed Nov 9, 2014
1 parent 130eb1e commit 088fd18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/jekyll-paginate/pagination.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def paginate(site, page)
# Returns the url of the template page
def self.first_page_url(site)
if page = Pagination.new.template_page(site)
page.url
page.url.chomp("index.html")
else
nil
end
Expand Down
10 changes: 5 additions & 5 deletions spec/pager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
let(:site) { build_site }

it "determines the correct pagination path for each page" do
expect(described_class.paginate_path(site, 1)).to eql("/index.html")
expect(described_class.paginate_path(site, 1)).to eql("/")
expect(described_class.paginate_path(site, 2)).to eql("/page2")
end
end
Expand All @@ -24,7 +24,7 @@
let(:site) { build_site({'paginate_path' => '/blog/page-:num'}) }

it "determines the correct pagination path for each page" do
expect(described_class.paginate_path(site, 1)).to eql("/index.html")
expect(described_class.paginate_path(site, 1)).to eql("/")
expect(described_class.paginate_path(site, 2)).to eql("/blog/page-2")
end
end
Expand All @@ -33,7 +33,7 @@
let(:site) { build_site({'paginate_path' => '/blog/page/:num'}) }

it "determines the correct pagination path for each page" do
expect(described_class.paginate_path(site, 1)).to eql("/index.html")
expect(described_class.paginate_path(site, 1)).to eql("/")
expect(described_class.paginate_path(site, 2)).to eql("/blog/page/2")
end
end
Expand All @@ -42,7 +42,7 @@
let(:site) { build_site({'paginate_path' => '/contacts/page:num'}) }

it "determines the correct pagination path for each page" do
expect(described_class.paginate_path(site, 1)).to eql("/contacts/index.html")
expect(described_class.paginate_path(site, 1)).to eql("/contacts/")
expect(described_class.paginate_path(site, 2)).to eql("/contacts/page2")
end
end
Expand All @@ -51,7 +51,7 @@
let(:site) { build_site({'paginate_path' => '/contacts/page/:num'}) }

it "determines the correct pagination path for each page" do
expect(described_class.paginate_path(site, 1)).to eql("/contacts/index.html")
expect(described_class.paginate_path(site, 1)).to eql("/contacts/")
expect(described_class.paginate_path(site, 2)).to eql("/contacts/page/2")
end
end
Expand Down

0 comments on commit 088fd18

Please sign in to comment.