iwarner / middleman-blog-test

Repository to test Blog nuisances and setup.
https://middlemanapp.com
GNU General Public License v3.0
1 stars 1 forks source link

per_page : option, how is this meant to work? #2

Open andreamoro opened 7 years ago

andreamoro commented 7 years ago

Can u please provide clarity on how this is meant to work? I've tried with something like

---

# Blog
pageable : true
per_page : 1

# Template
template : true

---

<ul>
  <% blog("blog_en").tags.each do |tag, articles| %>
    <li>
      <h5><%= tag %></h5>
      <ul>
        <% articles.each do |article| %>
          <li><a href="<%= article.url %>"><%= article.title %></a></li>
        <% end %>
      </ul>
    </li>
  <% end %>
</ul>

And I was expecting to see just one article printed, but I got the two that are in my testing environment. Can you please shed a light, please?

iwarner commented 7 years ago

I always use

I have little context what this page is also - is it a template page? i.e. called via : blog.tag_template = "blog-tag.html"

Or a standard page template?

see - https://github.com/iwarner/middleman-blog-test/blob/master/source/template/tag.html.haml

Please try and spend a little more time outlining the details.

andreamoro commented 7 years ago

It was a Tag template, the same I used before to test whether the locale it was working. I started from yours, but then it started firing errors on a "link" not available, so I quickly changed into the code above as I was in a rush.

Using the page_articles it prints out just one article, so I assume the pagination works then.

I always get confused when using one rather than the other method.

Can I suggest an edit to the https://middlemanapp.com/basics/blogging/ page, at the page_articles definition so to get this into:

page_articles = The list of articles to display on a page. When pagination is active, the list of articles returned on a page is limited to per_page