spanezz / staticsite

Static site generator
GNU General Public License v3.0
46 stars 7 forks source link

Archive link appears in the wrong place if pages!=10 #71

Closed eichin closed 2 months ago

eichin commented 2 months ago

Found this by inspection - themes/default/lib/blog.html (I was looking for a way to make it more obvious that there's more content in the archive, rather than it being just a footer link when you've reached the end.)

{% macro pages(pages, limit=10) -%}
  {% for entry in syndicated_pages(pages, limit=limit + 1) %}
    {% if loop.index == 11 %}

Pretty sure that should be {% if loop.index == limit+1 %} instead, and if I tweak the template in my currently-11-post site to say {{blog.pages(limit=20)}}, sure enough the Archive of all posts link appears between the 10th and 11th posts on the main page.

spanezz commented 2 months ago

Thanks, and indeed limit + 1 was the right value