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

GithubPage Posts page works only with an ending / #40

Open
davideghz opened this issue Apr 19, 2018 · 1 comment
Open

GithubPage Posts page works only with an ending / #40

davideghz opened this issue Apr 19, 2018 · 1 comment

Comments

@davideghz
Copy link

davideghz commented Apr 19, 2018

Hi, I know this plugin is no longer maintained, but since the new paginate-v2 is not supported by github pages, I hope to get some assistance here :)

My site's structure is pretty straightforward, with the paginated list of posts under the path :root/posts.
I achieved that with the following setup:

files tree

.
├── index.md
├── _layouts
│   ├── default.html
│   ├── home.html
│   ├── post.html
│   └── posts.html
├── posts
│   └── index.html
├── _posts
│   ├── 1986-08-01-hello-world.md
│   ├── 2017-03-09-welcome-to-jekyll.md
│   └── 2018-04-18-today.md
├── posts.md
...

_config.yml

# Plugins
plugins:
  - jekyll-paginate

# Permalinks
permalink: :title:output_ext

# Pagination
paginate: 2
paginate_path: "/posts/page:num"

In my local environment when I browse localhost:4000/posts I get redirected to localhost:4000/posts/ (note the ending /) and paginator works just fine.

On my live website when I browse davideghezzi.com/posts I don't get redirected and the paginator does not work. If I manually browse davideghezzi.com/posts/ (with the ending /) it works.

How can I address this issue?

p.s. you can find source code here https://github.com/davideghz/davideghz.github.io

@davideghz
Copy link
Author

davideghz commented Apr 19, 2018

Well, maybe not the most elegant solution, neither the best SEO oriented solution, but I got it working with:

Gemfile

group :jekyll_plugins do
  ...
  gem "jekyll-redirect-from"
end

_config.yml

plugins:
  - jekyll-redirect-from

posts.md

---
layout: posts
redirect_to:
  - /posts/
---

Pls let me know if you know better solutions

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

1 participant