generated from inherentlee/11ty
I won't even try to chunk this up
This commit is contained in:
@@ -6,6 +6,12 @@ export default function (eleventyConfig) {
|
||||
return Object.keys(target);
|
||||
});
|
||||
|
||||
eleventyConfig.addFilter("getYear", (target) => {
|
||||
if (target.data.tags.includes("2024")) return "2024";
|
||||
if (target.data.tags.includes("2025")) return "2025";
|
||||
if (target.data.tags.includes("2026-2027")) return "2026-2027";
|
||||
});
|
||||
|
||||
/* Return n elements from a list */
|
||||
eleventyConfig.addFilter("head", (collection = [], n) => {
|
||||
if (!Array.isArray(collection) || collection.length === 0) {
|
||||
@@ -56,4 +62,9 @@ export default function (eleventyConfig) {
|
||||
eleventyConfig.addFilter("sortAlphabetically", (strings) =>
|
||||
(strings || []).sort((b, a) => b.localeCompare(a)),
|
||||
);
|
||||
|
||||
eleventyConfig.addFilter("sortAlphabeticallyByArtist", (collection) => {
|
||||
collection.sort((b, a) => b.data.artist.localeCompare(a.data.artist));
|
||||
return collection;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user