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

Support for Pagination (issue #496) #589

Merged
merged 7 commits into from
Aug 16, 2020
Merged

Support for Pagination (issue #496) #589

merged 7 commits into from
Aug 16, 2020

Conversation

tlienart
Copy link
Owner

Oh gosh finally...

Support for pagination, works like:

@def some_list = ["<li>$lc</li>" for lc in ("Stefan", "Jeff", "Alan", "Viral")]
~~~<ul>~~~
{{paginate some_list 2}}
~~~</ul>~~~

Assuming this is on page foo.md it will lead to

  • /foo/ and /foo/1/ with content <li>Stefan</li><li>Jeff</li>
  • /foo/2/ with content <li>Alan</li><li>Viral</li>

Note: this can be used with any sort of list or item, so it doesn't necessarily need to be a <li>... in fact it could be div blocks. More specific functionality can be wrapped in a newcommand e.g.:

\newcommand{\paginated_list}[2]{~~~<ul>~~~{{paginate #1 #2}}~~~</ul>~~~}

(will be a demo in FranklinFAQ)

closes #496

Note: if pagination over 5 pages then changing something and paginating over 2 pages, the dirs 3,4,5 will be removed. This should generally be innocuous with the exception of people who want to paginate their front page in which case it may be more likely to have numeric dirs in __site (but not very so probably still fine).

@tlienart tlienart merged commit 1d6b9e8 into master Aug 16, 2020
@tlienart tlienart mentioned this pull request Aug 16, 2020
38 tasks
@tlienart tlienart deleted the pagination branch September 26, 2020 13:35
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

Successfully merging this pull request may close these issues.

Pagination support
1 participant