avillafiorita / jekyll-datapage_gen

Generate one page per yaml record in Jekyll sites.
369 stars 80 forks source link

Example of filter option #37

Closed stevetrask closed 6 years ago

stevetrask commented 6 years ago

First of all this is a great plugin!

I have tried to find an example of the filter option but to no avail.

How would I use the filter option if I am trying to generate pages where the a record property value is 'example_category' ? or is it that it just exists? I am sure soon as I see an example I will understand it a lot more.

Essentially I want to generate pages only with a certain category value

avillafiorita commented 6 years ago

very good suggestion! Added in the todo list: I will hopefully come back with an example page soon. thanks again.

avillafiorita commented 6 years ago

Hi, I have updated the README file with an example of filter and extended the plugin to support more complex conditions.

Have a look at the documentation of the filter and at the filter_condition parameters. The example site contains some working code.

If you have a chance to read and test it, I'll close the issue.

stevetrask commented 6 years ago

From an initial look it looks fantastic! Thank you for the super quick turnaround, I will run a test in a bit and let you know.

stevetrask commented 6 years ago

Just wanted to loop back and it works perfectly, to add a bit of context I am pulling product data from a google sheet then generating a page per record. With this enhancement we can now generate products pages with categories in the structure such as

domain/safety/product-name-here/ domain/accessories/another-product-name-here/

There is lots of potential with this modification especially if you use contentful.com

Thanks again

avillafiorita commented 6 years ago

Excellent, glad to know the new version works! Thank for you input and feedback.

I'll close the issue.