-
-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blending a collection from data and files #617
Comments
My last-resort workaround is similar to what @MadeByMike did for #587 … so maybe this is a duplicate. I have also explored the flip side: adding a collection to the returned results of a Javascript data file. Then I run into something akin to #437 because I cannot access collections. |
I’ve tried iterating through a range (1–3000) and using .getFilteredByGlob() to weave in existing pages … but performance was abysmal. So far it seems that generating files for the missing numbers with a gulp task is actually faster than any “smart” solution I’ve tried. But this feels icky so I continue to experiment. |
For the record, I created a minimal case here: https://github.com/gerwitz/eleventy-sparse-collection |
This would be trivial to implement with "virtual templates" #1612 |
I think I want to combine the two approaches discussed in #546. I'm hoping someone here can help me figure out how this is possible:
I have a collection of numbered template files, let's say:
I wish to output a complete list of pages with a larger range, e.g.
1–5
. Pages such as2
that don't have a matching file would have default content (this is easy enough with the layout). In reality, there are thousands so I don't want to pre-create dummy template files.So my hope is to create a Javascript "data" file that generates dummy templates, then merge the resulting collection with the extant template files. Or merge them from within the Javascript data file itself, though I don't think it has access to the right context scope.
Alternatively, I would like to create template entities on the fly within
.addCollection()
.Any tips or ideas are welcome!
The text was updated successfully, but these errors were encountered: