danielbayerlein / middleman-casper

👻 Casper theme (Ghost) for Middleman-Blog
134 stars 18 forks source link

Pagination does not work #5

Closed wellsonjain closed 9 years ago

wellsonjain commented 9 years ago

hi,

I got this issue. When i new several articles, says "10 articles" , and I set the blog.paginate = true in config.rb in index.html.haml


---
pageable: true
per_page: 5

---

Expected the first page will be the first five article, and the second page will be the last five article. But the second page still get the first five article. I try to remove the per_page in index, and set the blog.per_page in config, but it still doesn't work. Is there any configurations i set wrong?

here's my middleman-blog config:

activate :blog do |blog|
  # Matcher for blog source files
  blog.taglink = "tag/{tag}.html"

  blog.tag_template = "tag.html"

  # Enable pagination
  blog.paginate = true
  # blog.per_page = 5
end
danielbayerlein commented 9 years ago

Hi @wellsonjain,

are you using the latest version of middleman-casper? In the previous versions I had this error. The solution is contained in this commit: dc47c0b030a7c39595c1575181b7e711b2e7961c

-  = partial(:page_articles)
+  = partial(:page_articles,
+            locals: { page_articles: page_articles, paginate: paginate })

I look forward to your feedback.

wellsonjain commented 9 years ago

Hello @danielbayerlein,

i just updated the latest version and generate a new blog, and it work perfect!!! Since i've already made many my own settings and deployed on github. Is there any way that i can update my blog to the new version without generating a new one?

danielbayerlein commented 9 years ago

@wellsonjain Thanks for your feedback!

You can update the template with the following steps:

$ git remote add middleman-casper https://github.com/danielbayerlein/middleman-casper.git
$ git pull middleman-casper master
wellsonjain commented 9 years ago

Sweet!!! Updated!! I'm not quite familiar with git. it's really helpful!!