Skip to content

Next/previous collection with permalink: false #1524

Open
@h0r0m4n

Description

@h0r0m4n

The items in the collection that contains permalink: false is still considered to be a next or previous post during 11ty rendering.

To Reproduce
Posts structure:

posts/post-a.md
posts/post-b.md -> permalink: false
posts/post-c.md

Prev/Next:

<ul>
    {% set previousPost = collections.posts | getPreviousCollectionItem(page) %}
    {% if previousPost %}<li><a href="{{ previousPost.url }}">{{ previousPost.data.title }}</a></li>{% endif %}

    {% set nextPost = collections.posts | getNextCollectionItem(page) %}
    {% if nextPost %}<li><a href="{{ nextPost.url }}">{{ nextPost.data.title }}</a></li>{% endif %}
</ul>

Expected behaviour
When I open http://localhost:8080/posts/post-a/ the URL of the next post is http://localhost:8080/posts/post-b/false instead of http://localhost:8080/posts/post-c/

Environment

  • Eleventy: v0.11.1
  • NodeJS: v14.15.0
  • OS: Big Sur 11.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    educationfeature: 📞 collectionsRelated to Eleventy’s tags/collections featurefeature: 📦 paginationRelated to Eleventy’s pagination featurefeature: 🪨 permalinkRelated to the `permalink` feature to control where the file’s output is written

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions