This commit is contained in:
Zach Leatherman committed 2020-10-16 13:06:30 -05:00
1 parent 61885752b6
commit d28f834fbb
2 files changed
+6 -1

No files matched your search

+4
View File
@@ -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) {
+2 -1
View File
@@ -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 %}