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

Strip .html from the paginated pages (/articles/page2.html) to (/articles/page2/ #56

Closed
shawnolson-fp opened this issue Nov 30, 2017 · 3 comments

Comments

@shawnolson-fp
Copy link

I'm using pagination but am pointing it to an "articles" page, not index.html in root. I've created an "articles" folder and added a new index.html to that folder (acting as the blog page).

My permalink settings are
permalink: /:num/ (I've also tried /:num and /articles/:num)

and my link in the page is {{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}

Everything works great except it adds a .html extension to all the pages - which results in duplicate content, since there are the same two pages at /articles/page2.html and /articles/page2/

Any assistance is much appreciated

@shawnolson-fp
Copy link
Author

Nevermind, I see there are already a few concerns about this.

Looks like the fix as of now is adding {{ paginator.next_page_path | replace: 'index.html', '' | prepend: site.baseurl }} to the index page.

Thanks,
Shawn - fencepencil

@sverrirs
Copy link
Owner

@shawnolson-fp
Copy link
Author

Works perfectly, thank you so much!!!

Shawn - fencepencil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants