-
-
Notifications
You must be signed in to change notification settings - Fork 265
Closed
Description
In Jekyll, it is possible to do
{%- assign tags_by_size = site.tags | group_by_exp: 'tag', 'tag[1].size' | sort: 'name' | reverse -%}
{%- for tags_with_size in tags_by_size -%}
{%- for tag in tags_with_size.items -%}
{%- assign tag_name = tag[0] -%}
<!-- ... -->
{{ tag_name }} <sup>{{ tags_with_size.name }}</sup> <!-- tag name and count -->
<!-- ... -->
{%- for post in tag[1] %}
<!-- render each post with this tag -->
<!-- ... -->However, in liquidjs, collections.postsByTag | group_by_exp: 'tag', 'tag[1].size' (where collections.postsByTag in Eleventy is in the same format as site.tags in Jekyll) just ends up being [ { name: undefined, items: [ [Object] ] } ]
Running collections.postsByTag through Object.entries makes this filter work properly.
This came up while migrating from Jekyll to Eleventy, but I will probably end up reimplementing this functionality, so I might not need it in the end, but I am reporting this missing functionality here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels