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

Index variables don‘t exist despite enabled pagination #310

Closed
nerdcoding opened this issue Oct 20, 2016 · 2 comments
Closed

Index variables don‘t exist despite enabled pagination #310

nerdcoding opened this issue Oct 20, 2016 · 2 comments

Comments

@nerdcoding
Copy link

Problem

I used the latest JBake 2.5.0 release, enabled paging and set the post per page parameter:

index.paginate=true
index.posts_per_page=10

However in my freemarker template the variables nextFileName and previousFileName does not exist:

<#if (nextFileName)??> <#-- is always false -->
   [...]
</#if>
<#if (previousFileName)??> <#-- is always false -->
   [...]
</#if>

Possible solution

In org.jbake.app.Renderer#renderIndex() the variables are put to the model map:

[…]
model.put("previousFileName" …);
[…]
model.put("nextFileName",  …);
[…]

But the model is never given to freemarkers template engine. Maybe here the ModelRenderingConfig is needed instead of the used DefaultRenderingConfig.

@SergeyPirogov
Copy link

Have the same issue

ancho added a commit to ancho/jbake that referenced this issue Oct 28, 2016
…the model

* adds `currentPageNumber` to the model
* adds `numberOfPages` to the model
@jonbullock
Copy link
Member

Thanks for taking the time to raise an issue about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants