Fixes #70
This commit is contained in:
parent
61885752b6
commit
d28f834fbb
@ -33,6 +33,10 @@ module.exports = function(eleventyConfig) {
|
||||
return array.slice(0, n);
|
||||
});
|
||||
|
||||
eleventyConfig.addFilter("min", (...numbers) => {
|
||||
return Math.min.apply(null, numbers);
|
||||
});
|
||||
|
||||
eleventyConfig.addCollection("tagList", function(collection) {
|
||||
let tagSet = new Set();
|
||||
collection.getAll().forEach(function(item) {
|
||||
|
@ -5,7 +5,8 @@ eleventyNavigation:
|
||||
order: 1
|
||||
---
|
||||
|
||||
<h1>Latest 3 Posts</h1>
|
||||
{% set maxPosts = collections.posts.length | min(3) %}
|
||||
<h1>Latest {% if maxPosts == 1 %}Post{% else %}{{ maxPosts }} Posts{% endif %}</h1>
|
||||
|
||||
{% set postslist = collections.posts | head(-3) %}
|
||||
{% set postslistCounter = collections.posts | length %}
|
||||
|
Loading…
Reference in New Issue
Block a user