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

Improved pagination support #521

Closed
wants to merge 1 commit into from
Closed

Improved pagination support #521

wants to merge 1 commit into from

Conversation

devknoll
Copy link

@devknoll devknoll commented Mar 8, 2012

  • Exposed some properties in Page that weren't previously available.
  • Folded in jekyll-pagination to support non-Index.html pagination and allowing for paginating files in sub-directories (e.g. /blog/index.html)
    • Defaults to index.html for backward compatibility.
  • Allow for customizing the pagination url style (e.g. /blog/page/:page => /blog/page/1).
    • Defaults to page:page (page#) for backward compatibility.

* Folded in jekyll-pagination with additional support for paginating files in directories and modifying the pagination url style.
@craig552uk
Copy link

+1 for non-index.html pagination.

@Stiivi
Copy link

Stiivi commented Mar 22, 2012

+1 for customizing pagination URL style. It would be great if I can have project site landing page to be 'about the project' and then to have blog in a sub-directory as '/blog/*'.

@dnadlinger
Copy link

A lot of people (including me) have been using custom hacks for pagination in subdirectories – I'd love to have it available by default.

@nathggns
Copy link

How has this not been accepted yet?!?!?!?

@ghost
Copy link

ghost commented Apr 11, 2012

@nathggns if you havent noticed there are over 200 issues on this repo, and not a commit in 2 months. I would suggest using a fork or making your own.

@nathggns
Copy link

@svnpenn How would I go about doing this? Like many others, I installed Jekyll with gem install jekyll. I have no idea how to use a different fork.

@devknoll
Copy link
Author

If you just want these changes, you can drop the modified pagination.rb and page.rb into your _plugins folder and they will just work. Keep in mind that this won't work with GitHub Pages.

@nathggns
Copy link

@devknoll Thanks, but I noticed it doesn't work plug and play. What extra work do I have to do? I put that in plugins and it actually broke page1 (blog/index.html)

@ghost
Copy link

ghost commented Apr 11, 2012

If you just want these changes, you can drop the modified pagination.rb and page.rb into your _plugins folder and they will just work. Keep in mind that this won't work with GitHub Pages.

That is incorrect. It will work with GitHub pages, as long as you dont rely on GitHub's Jekyll to do the transforming.

@cpence
Copy link

cpence commented Apr 30, 2012

This would be a great addition! Category pagination seems to be one of the most commonly requested features, and this is a pretty seamless way to get it working.

newpage.pager = pager
newpage.dir = File.join(page.dir, "page#{num_page}")
newpage.dir = File.join(page.dir, template.gsub(/:page/, num_page.to_s))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my installation, I had to change this to File.join(page.source_dir instead of page.dir. This was for paginating blog/index.html; as-is it kept generating the page2 folder in the root directory instead of in blog/, as page.dir just returned /. I'm new to Jekyll so I'm not sure if this is a bug with the patch or a bug in my setup or configuration.

@joshferrara
Copy link

+1 on pagination in subdirectories. I host my jekyll blog with gh-pages, so to have this in by default would be great.

@aaronmoodie
Copy link

+1 on this as well.

@mhumeSF
Copy link

mhumeSF commented Oct 8, 2012

+1 for customizing pagination URL style

@yanping
Copy link

yanping commented Oct 14, 2012

+1 for pagination in subdirectories

@bcomnes
Copy link
Contributor

bcomnes commented Nov 11, 2012

I would really like to see this. Every way around this limitation feels like a hack, or plugin.

@thomasgilgenast
Copy link

+1 for pagination in subdirectories

@lewtds
Copy link

lewtds commented Dec 21, 2012

Oh @mojombo please merge this :(

@nimbupani
Copy link

I want these features, but I am no expert on whether this code is worthy or not. But I would love to have this feature available for my github pages blog!

@parkr
Copy link
Member

parkr commented Dec 25, 2012

@devknoll You must add tests before this will be considered for integration into the project. Thanks for the hard work, though.

@parkr
Copy link
Member

parkr commented Dec 26, 2012

@nimbupani The status of this repository and that of GitHub Pages have little to to with one another.

@bcomnes
Copy link
Contributor

bcomnes commented Dec 26, 2012

One workaround to have a paginated blog on a different page than the index with the restrictions of gh-pages is to have your main, non-paginated website pages in your [username].github.com repository, then your paginated blog in a separate repository with the name of whatever sub-page you want your paginated blog under. IE:

This is the main landing page + any other pages: https://github.com/username/username.github.com
And this would be your paginated blog index: https://github.com/username/blog (gh-pages branch)
Don't forget to provide links between the two on each site!

The second website should respect your CNAME that is set in [username].github.com and work seamlessly with that repository. There might even be some creative room for submodules in this mix.

Inspiration for this idea came from how https://github.com/yihui/yihui.github.com deals with two separate languages on his website.

Technically, its two separate sites, but if you want additional pages paginated, and you don't want to use plugins or are deploying to gh-pages, then this works right now.

It would be nice to be able to arbitrarily paginate sections of a site, IE paginated blog index that isn't the main index while also paginating other pages on the same website like an archives page. Octopress has some really basic support for this kind of thing.

@nimbupani
Copy link

Sure. But if it were in the core and if Github Pages were upgraded then
I would have some chance of using it :) For anything, is the first step
not to have it as part of Jekyll?

@parkr
Copy link
Member

parkr commented Jan 18, 2013

Yeppers.

This will require tests so we don't break it in the future.

@plc
Copy link

plc commented Feb 12, 2013

it seems like custom pagination urls were added, but not the ability to paginate content on pages other than the main index.html, for example blog/index.html does not respect the paginate_path – it defaults to blog/page2.

@parkr
Copy link
Member

parkr commented Mar 17, 2013

The modifications to Page that you made here were merged in #536.

@mojombo, what do think about the rest of the changes?

@Karmac
Copy link

Karmac commented Mar 24, 2013

I can use paginate_path to change the path, but how can I change the index.html file name inside of them?
Thanks.

@plc
Copy link

plc commented Apr 3, 2013

any updates on this? my paginated generated pages don't use the correct layout

@parkr parkr mentioned this pull request Apr 7, 2013
@parkr
Copy link
Member

parkr commented Apr 9, 2013

Re-done on #936.

@parkr parkr closed this Apr 9, 2013
@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet