Support array values in findBy filter for multiple authors#1969
Open
Support array values in findBy filter for multiple authors#1969
Conversation
Allow the findBy filter to match against array fields, enabling support for multiple authors on starters, plugins, etc. e.g. "author": ["user-a", "user-b"]
Demonstrates the new array support in the findBy filter by listing multiple authors on FreshJuice starter projects.
Ryuno-Ki
reviewed
Feb 9, 2026
eleventy.config.js
Outdated
|
|
||
| if (Array.isArray(gotten)) { | ||
| if (typeof value === "string") { | ||
| let valueLower = value.toLowerCase(); |
Contributor
There was a problem hiding this comment.
This might lead to some issues down the line (Turkish-I problem).
I recommend using localeCompare instead.
Contributor
Author
There was a problem hiding this comment.
Great catch, thanks! Switched to localeCompare with { sensitivity: "base" } in both the array and string comparison paths.
Avoids the Turkish-I problem and other locale-specific casing issues.
Ryuno-Ki
reviewed
Mar 9, 2026
Contributor
Ryuno-Ki
left a comment
There was a problem hiding this comment.
LGTM (But I don't have permissions to actually get this PR in)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
findByfilter ineleventy.config.jsto support array values, enabling fields likeauthorto list multiple authors["freshjuice-dev", "reatlat"]as a real-world use caseProblem
Currently, starters (and plugins) can only have a single
authorstring. This means a project with multiple contributors can only appear on one author's page.Solution
Add an
Array.isArray()check to thefindByfunction so that when a field value is an array, it matches if any element in the array equals the search value. This is fully backward-compatible — existing string values continue to work unchanged.Test plan