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

Limit Index to recent posts and create all post history #28

Closed
KyleMit opened this issue Aug 30, 2019 · 0 comments
Closed

Limit Index to recent posts and create all post history #28

KyleMit opened this issue Aug 30, 2019 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@KyleMit
Copy link
Member

KyleMit commented Aug 30, 2019

Need to add a filter to limit collection

eleventyConfig.addFilter("head", (array, n) => {
    // Get the first `n` elements of a collection.
    return array.slice(0, n);
});

Then use the filter in the template

{% set postslist = collections.posts | head(10) %}

Add a section title "Recent Posts"

Add a link to all posts at the bottom

@KyleMit KyleMit closed this as completed Sep 1, 2019
@KyleMit KyleMit added the enhancement New feature or request label Sep 3, 2019
@KyleMit KyleMit added this to the v0.3-beta milestone Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant