Skip to content

Commit c7d3d96

Browse files
committed
updated deps / call to action in articles / improved footer
1 parent 589b5ba commit c7d3d96

File tree

5 files changed

+421
-739
lines changed

5 files changed

+421
-739
lines changed

_11ty/nunjucksFilters.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ module.exports = function nunjucksFilters (config) {
2727
return markdown.render(value)
2828
})
2929

30+
// Add custom filter to remove a content with a given URL from a list of pages
31+
config.addFilter('removeUrl', function matchUrl (elements, url) {
32+
return elements.filter((el) => el.url !== url)
33+
})
34+
35+
// Add custom filter to keep the top X elements of an array
36+
config.addFilter('keep', function keep (arr, n) {
37+
return arr.slice(0, n)
38+
})
39+
3040
// Add currentYear helper
3141
config.addNunjucksShortcode('currentYear', function () {
3242
return `${new Date().getFullYear()}`

0 commit comments

Comments
 (0)