Open jvanulde opened 3 years ago
sorry for taking so long.
The simplest answer is restructuring the yaml, so that the key is accessible as a field, e.g., something like:
records:
- id: record-1
title: My First Record
- id: record-2
title: My Second Record
If that does not work for you, you could try with name_expr
, using the same expression you would use in a for loop in Liquid, For instance on the assumption the following code:
{% for data in site.data.records.records %}
- {{ EXPR_TO_GET_KEY }}
{% endfor %}
generates
then a configuration which might work is:
page_gen:
- data: 'data.records'
name_expr: EXPR_TO_GET_KEY
I hope it helps. Let me know if it answer your question.
For example I have the following data.yml:
My configuration for page-gen is as follows:
This results in filenames like
my-first-record.html
but I require them to be likerecord-1.html
.How can I configure page-gen to do this?