A new collection with a different archive, not tags, year, status, or categories #3495
Replies: 2 comments 2 replies
-
|
This took me a while to figure out, but here is the thing: Jekyll has special built-in handling for certain fields like categories and tags. It automatically converts them to arrays when parsing the YAML frontmatter, and apparently this is not exclusive to posts, but applies to any collection. However, custom fields like the one you are trying to use don't get this special treatment and remain as strings. How did I find out? I wrote some outputs to the {% assign categories = page.categories | join: '' %}
{% assign tablets = page.tablets | join: '' %}
Categories str: {{ page.categories | jsonify }}
Categories: {{ categories | jsonify }}
Tablets str: {{ page.tablets | jsonify }}
Tablets: {{ tablets | jsonify }}And here is the code that is created: As you can see, The solution: convert {% assign page_tablets = page.tablets | split: ' ' %}
{% for tablet in page_tablets %}I added this information to CUSTOMIZE.md. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
I want to create a new collection and group it by a new feature. For example, I am creating a new collection named
animesand I want to have the different formats on each review (anime, film, ova, web-comic, etc). I extended the current implementation of the other collection's group and updated three files:_config.yml,anime-review.liquid, andarchives.liquid. The codes are the following:# My new collection named anime-review.liquid {% assign formats = page.formats | join: '' %} .... {% if formats != '' %} · {% for format in page.formats %} <a href="{{ format | slugify | prepend: '/animes/type/' | relative_url }}"> <i class="fa-solid fa-clapperboard fa-sm"></i> {{ format }}</a> {% unless forloop.last %} {% endunless %} {% endfor %} {% endif %}The corresponding config is
Although everything is almost the same, except by the names, it is like the for cycle does not work correctly and does not split the string I am giving to each review, for example:
formats: manga anime film video-game. It is taken as a single element, a single format, which is not what I want. The result is the following, last part:It is so weird because I am following the template, and the current code is creating the following index, for the format grouping:
Any idea how I can fix it? Is it related to the gems or the configuration?
Beta Was this translation helpful? Give feedback.
All reactions