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

Enable Pagination #48

Closed
hamelsmu opened this issue Feb 15, 2020 · 13 comments
Closed

Enable Pagination #48

hamelsmu opened this issue Feb 15, 2020 · 13 comments
Assignees

Comments

@hamelsmu
Copy link
Collaborator

@hamelsmu hamelsmu commented Feb 15, 2020

I haven't tested if pagination is working (when you have more than N posts and want previous and next butttons) .

Here is an article that may help . https://blog.webjeda.com/jekyll-pagination/

@mikonapoli

This comment has been minimized.

Copy link
Contributor

@mikonapoli mikonapoli commented Feb 16, 2020

Had a read to the docs linked, and wanted to have a stab at this after I finished with #49 but I cannot find where the post list is built in the index page. In other words: index.md contains only a bit of content, but when the site is actually built a list of posts is added. I think I am looking for the "home" layout, but I cannot find it

@mikonapoli

This comment has been minimized.

Copy link
Contributor

@mikonapoli mikonapoli commented Feb 16, 2020

I have tried for a bit, but the answer is that apparently it is not possible, or not in an easy way. There are two main issues:

  1. Although this minima layout has been pushed to master, for some reason it's not being picked up (we might be using a different theme or a different version, I don't know). This is not a major deal, and it can be solved with a custom layout, although it is a bit hacky

  2. The paginator requires the index to be index.html rather than index.md (I am guessing so that it can duplicate it several time depending on how many pages are needed. This does not seem easily solvable to me unless we are willing to break the basic assumptions of fastpage.

@hamelsmu

This comment has been minimized.

Copy link
Collaborator Author

@hamelsmu hamelsmu commented Feb 16, 2020

Indeed looks like pagination is built in to the currenty version of minima, however, they haven't cut a release yet so its not available for people installing via Gem.

I'm not adventurous enough to copy their files etc. Perhaps we look at the upcoming 3.0 release and see what has changed ( or actually wait until 3.1 )

@mikonapoli

This comment has been minimized.

Copy link
Contributor

@mikonapoli mikonapoli commented Feb 17, 2020

Perhaps. Should we label this issue as "waiting" or something?

@hamelsmu

This comment has been minimized.

Copy link
Collaborator Author

@hamelsmu hamelsmu commented Feb 18, 2020

I’ll keep it open for a bit :)

@hamelsmu hamelsmu changed the title Ensure Pagination is working Enable Pagination Feb 21, 2020
@zonca

This comment has been minimized.

Copy link
Contributor

@zonca zonca commented Mar 9, 2020

I made pagination working following jekyll/minima#150 (comment)

  1. Added gem 'jekyll-paginate' to Gemfile

  2. added to _config.yml:

gems:
  - jekyll-paginate

paginate: 10
paginate_path: /page:num/
  1. I had an empty index.md so just renamed it, I guess people with some content should turn it into html.

     mv index.md index.html
    

See at: https://zonca.dev/

@hamelsmu

This comment has been minimized.

Copy link
Collaborator Author

@hamelsmu hamelsmu commented Mar 9, 2020

@zonca this is great! Thanks for sharing! I'll get around to this soon

@hamelsmu

This comment has been minimized.

Copy link
Collaborator Author

@hamelsmu hamelsmu commented Mar 9, 2020

One issue with using the paginate plugin is that you have to convert index.md to index.html, and it becomes much harder to write content this way. Any ideas on how to make things easier to let people write content on their home page?

@zonca

This comment has been minimized.

Copy link
Contributor

@zonca zonca commented Mar 9, 2020

@hamelsmu What if in the build action fastpages adds a script which converts index.md to index.html before it is processed by Jekyll?

@hamelsmu

This comment has been minimized.

Copy link
Collaborator Author

@hamelsmu hamelsmu commented Mar 9, 2020

No that wouldn't work in this case. And there isn't a way to ship markdown inside HTML, either. the best way is to try to find a way to port pagination to markdown via {% includes %} or something like that or by extending _layout/home.html

@zonca

This comment has been minimized.

Copy link
Contributor

@zonca zonca commented Mar 9, 2020

what if you strip the front matter, do the conversion using pandoc or some other tool, and join back the front matter?

@hamelsmu

This comment has been minimized.

Copy link
Collaborator Author

@hamelsmu hamelsmu commented Mar 10, 2020

@zonca don't want to hack it like that seems like it would not be very maintainable.

I'm thinking to just put a link to your instructions in the documentation instead?

@zonca

This comment has been minimized.

Copy link
Contributor

@zonca zonca commented Mar 10, 2020

Sure

@hamelsmu hamelsmu self-assigned this Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.