Open drewbroadley opened 4 years ago
Hi,
thanks for the report. Is the issue you are running into a configuration problem, namely the fact that page_gen
is not specified in config.yml
as an array of hashes?
Even if you have a single data structure for which you want to generate individual pages, you still need to define page_gen
an array (of one element). Example:
page_gen:
- data: [name of a data set in _data]
template: [name of template in _layouts: will be used to render pages]
dir: [directory where filenames will be generated]
index_files: [true|false]
name: [field used to generate the filename]
name_expr: [a Ruby expression to generate the filename (alternative to name)]
title: [field used to generate the page title]
title_expr: [a Ruby expression to generate the filename (alternative to title)]
extension: [extension used to generate the filename]
filter: [property to filter data records by]
filter_condition: [a Ruby expression to filter data]
(note the "-" in front of data
)
Let me know if it solves the issue or I'll dig more into it.
Hey, I had a similiar error (no implicit conversion of String into Integer (TypeError)), but it was on my side!
Here is the part of my correct _config_yml
.
page_gen-dirs: true
page_gen:
- data: 'product_categories'
template: 'product_category'
name: 'name'
dir: 'products'
Here is my WRONG _config_yml
. I had the file extension (.json) included near the data
. Just omit the file extension and the issue was gone for me.
page_gen-dirs: true
page_gen:
- data: 'product_categories.json'
template: 'product_category'
name: 'name'
dir: 'products'
I am not sure how this is working for anyone?
The value bring provided to the "data" variable on line 93 is an array, yet the code is treating it like a hash. This makes the do loop not needed.
I need to remove the loop and rename "data_spec" to "data" and it works.
` data = site.config['page_gen'] if data
`
I'm using Jekyll 3.8.x and Ruby 2.7.0.