Files cat1, cat2, … have layout set to ‘category’
In _layouts/category.html I put something like this.
{%- case page.name -%}
{%- when ‘cat1.html’ -%}
{%- assign postlist = site.categories.Category1 -%}
{%- when ‘cat2.md’ -%}
{%- assign postlist = site.categories.Category2 -%}
{%- when ‘cat3.md’ -%}
{%- assign postlist = site.categories.Category3 -%}
{%- else -%}
{%- assign postlist = false -%}
{%- endcase -%}
How to simplify this code?
Thanks!