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

Pagination now works for index.html files in subfolders. Links to next page consider baseurl now. #764

Merged
merged 2 commits into from
Jan 24, 2017

Conversation

maik
Copy link
Contributor

@maik maik commented Jan 11, 2017

No description provided.

@mmistakes
Copy link
Owner

Sorry it took me awhile to review this. Everything looks good. Thanks for taking the time to get this working and submitting a PR.

@mmistakes mmistakes merged commit f4e75fe into mmistakes:develop Jan 24, 2017
mmistakes added a commit that referenced this pull request Jan 24, 2017
NicolasT referenced this pull request in NicolasT/nicolast.github.io Jan 29, 2017
* tag '4.2.1': (22 commits)
  Bump version to 4.2.1
  Update CHANGELOG and history
  Document moving paginated home page to an alternate location
  Pagination now works for index.html files in subfolders. Links to next page consider baseurl now. (#764)
  Pagination now works for index.html files in subfolders. Links to next page consider baseurl now. (#764)
  Add https prefix to google-universal embed code. (#772)
  Add https prefix to google-universal embed code. (#772)
  Bump version to 4.2.0
  Bump jekyll-sitemap to (1.0)
  Update CHANGELOG and history
  Improve video helper documentation
  Add video header support to `archive` and `splash` layouts
  Rename `responsive_video` helper to `video`
  Add some white-space below video embeds
  Add Nepali (Nepalese) text
  Add page hero video for vimeo/youtube using embedresponsively.com code (#788)
  Nepalese Language (#785)
  invalid `analytics` example fix (#783)
  Remove borders from table elements found in Google Custom Search Engine widget - Close #759
  Complete Simplified Chinese Translation of Theme UI (#747)
  ...
@Sarafian
Copy link
Contributor

Sarafian commented Feb 5, 2017

Sorry to hijack this pull request but I can't find the matching issue. I landed to this pr through the history file.

Can someone provide an example of how this improvement work?
I've created a page _pages/recent-archive.md with the expectation to show all recent posts with the pagination below.

---
layout: home
permalink: /recent/
author_profile: true
title: Recent Posts
---

But the paginator object is nil. I've tried to configure the _config.yaml with paginate_path: /recent/page:num/ and it created all other pages (e.g. _site\recent\page2 except the date on the first page _site\recent\index.html.
When using the default value no page folder is created in the _site.

Is this the unexpected limitation of Jekyll and pagination?

@mmistakes
Copy link
Owner

mmistakes commented Feb 5, 2017

@Sarafian Pretty sure the default Jekyll pagination only works with .html files. Rename to recent-archive.html and see if that fixes it.

Sounds like you have everything else configured correctly since you're getting /recent/page/x/index.html files generated.

@mmistakes
Copy link
Owner

@Sarafian Scratch that. Forgot about about some other Jekyll pagination limitations.

  • Filename has to be index.html or else it will be skipped.

So to do what you want rename _pages/recent-archive.md to /recent/index.html and then rebuild. For whatever reason you can't place pagination indexes inside of a folder like _pages.

You'll also want to remove permalink: /recent/ from that file's YAML Front Matter. Just need the following and everything should work:

---
layout: home
author_profile: true
title: Recent Posts
---

@Sarafian
Copy link
Contributor

Sarafian commented Feb 6, 2017

It worked indeed as you said. I'll summarize

  • Only index.html files can reference the pagination object.
  • When the root is not the desired location then create a folder e.g. recent and place the html file inside recent\index.html
    • In the _config.yaml make sure to set paginate_path: /recent/page:num/

Thanks @mmistakes. Once I finish with my setup I'll make check the files/documentation and try to enhance them with what I learned and submit a pull request.

@mmistakes
Copy link
Owner

mmistakes commented Feb 6, 2017

@Sarafian Strange. Just looked at your site and seems fine to me. Paginated /recent/ pages are there and populated with posts.

wetty added a commit to wetty/wetty-web that referenced this pull request Feb 7, 2017
…into gh-pages

* 'master' of https://github.com/mmistakes/minimal-mistakes: (22 commits)
  Bump version to 4.2.1
  Update CHANGELOG and history
  Document moving paginated home page to an alternate location
  Pagination now works for index.html files in subfolders. Links to next page consider baseurl now. (mmistakes#764)
  Pagination now works for index.html files in subfolders. Links to next page consider baseurl now. (mmistakes#764)
  Add https prefix to google-universal embed code. (mmistakes#772)
  Add https prefix to google-universal embed code. (mmistakes#772)
  Bump version to 4.2.0
  Bump jekyll-sitemap to (1.0)
  Update CHANGELOG and history
  Improve video helper documentation
  Add video header support to `archive` and `splash` layouts
  Rename `responsive_video` helper to `video`
  Add some white-space below video embeds
  Add Nepali (Nepalese) text
  Add page hero video for vimeo/youtube using embedresponsively.com code (mmistakes#788)
  Nepalese Language (mmistakes#785)
  invalid `analytics` example fix (mmistakes#783)
  Remove borders from table elements found in Google Custom Search Engine widget - Close mmistakes#759
  Complete Simplified Chinese Translation of Theme UI (mmistakes#747)
  ...

# Conflicts:
#	CHANGELOG.md
#	README.md
#	docs/_data/ui-text.yml
#	docs/_docs/05-configuration.md
#	docs/_docs/08-ui-text.md
#	docs/_docs/10-layouts.md
#	docs/_docs/14-helpers.md
#	docs/_docs/17-javascript.md
#	docs/_docs/18-history.md
#	docs/_includes/analytics-providers/google-universal.html
#	docs/_includes/page__hero.html
#	docs/_includes/paginator.html
#	docs/_layouts/archive.html
#	docs/_layouts/single.html
#	docs/_layouts/splash.html
#	docs/_pages/about.md
#	docs/_pages/home.md
#	docs/_sass/_utilities.scss
#	docs/assets/js/_main.js
#	docs/assets/js/main.min.js
#	minimal-mistakes-jekyll.gemspec
#	test/_data/ui-text.yml
RobinYu added a commit to RobinYu/robinyuuu.github.io that referenced this pull request Mar 7, 2017
kkunapuli pushed a commit to kkunapuli/kkunapuli.github.io that referenced this pull request May 30, 2019
…t page consider baseurl now. (mmistakes#764)

* Links to next page consider baseurl now.

* paginate_show_page_num controls whether page number gets output.
kkunapuli pushed a commit to kkunapuli/kkunapuli.github.io that referenced this pull request May 30, 2019
makaroniame added a commit to makaroniame/makaroniame-old.github.io that referenced this pull request May 18, 2022
…t page consider baseurl now. (mmistakes#764)

* Links to next page consider baseurl now.

* paginate_show_page_num controls whether page number gets output.
makaroniame added a commit to makaroniame/makaroniame-old.github.io that referenced this pull request May 18, 2022
jchwenger pushed a commit to jchwenger/jchwenger.github.io that referenced this pull request May 5, 2023
…t page consider baseurl now. (mmistakes#764)

* Links to next page consider baseurl now.

* paginate_show_page_num controls whether page number gets output.
jchwenger pushed a commit to jchwenger/jchwenger.github.io that referenced this pull request May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants