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

Have blog page outside of index.html completely #212

Closed
sylhare opened this issue May 21, 2020 · 5 comments
Closed

Have blog page outside of index.html completely #212

sylhare opened this issue May 21, 2020 · 5 comments

Comments

@sylhare
Copy link
Owner

sylhare commented May 21, 2020

So different from #104
This use case would be to use the home.html layout or the include blog.html to paginate the blog pages outside of the index.html.

It seems to be a paginate configuration issue.

Opened by @sylvietht in #17

@sylvietht
Copy link

Got it! Turns out the paginator doesn't work in any file other than index.html, so I created another index.html file at /blog/index.html, where I included the pagination logic. Now when I go to /blog, it displays the paginated posts, and the homepage remains static.

Thanks so much for your help and for that link, it got me on the right path! And thanks again for the fantastic theme.

@sylhare
Copy link
Owner Author

sylhare commented May 21, 2020

Ok I found the issue.
What you need to do, if you want to have your blog page outside of index.html completely.

blog                               # New directory
└── index.html         # Your new blog page

In your this blog/index.html you need to add this which will render the blog page:

---
layout: home
title: Blog
permalink: /blog/
---

And then update the paginator with:

# PAGINATION
paginate: 5
paginate_path: "/blog/page:num"

By doing so the blog page won't be rendered in the home page, and this one will be empty. You can customize the theme with blog.html which is the one actually using the paginator feature.

@sylhare
Copy link
Owner Author

sylhare commented May 21, 2020

Thanks @sylvietht I have modified the answer, now I don't get the error with No such file or directory @ rb_sysopen so I guess we're good for this one 😄

@sylhare sylhare closed this as completed May 21, 2020
@sylvietht
Copy link

Great! Thanks, yours looks like a good solution too (especially if one doesn't want to mess with the site navigation as you have it set up).

@selimerunkut
Copy link

pagination not worked with
permalink: /blog/

after removing, started working

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

3 participants