Hi there,
I am looking for a way to pass title and meta-description in my data file products.csv to front matter. I was looking around but couldn’t find a solution.
I am looking for something like this:
products.csv
"name","title","meta-description"
"toaster","Great toaster","A long glorification of the toaster."
Front matter
---
title: "{{ site.data.products.title where products.name == "toaster" }}"
description: "{{ site.data.products.meta-description where products.name == "toaster" }}"
Is something like this generally possible? If yes, how would I do it? Is such a case documented anywhere?
this is not supported in Jekyll - there are other threads on here about being able to use liquid inside the front matter, I think one of those posts may have referenced a plugin to help do that? not sure. But your case of wanting to use a data file is one step beyond that.
Sounds like you want to make each line of the data file into a page? I wanted to do that too at one point. I think I may have seen a plugin for that too.
maybe there is another way to do what you want, can you describe your use case? for instance I think you could access those inside a layout - so no need to have the meta stuff in the front matter.
even if there was a plugin to do some of what you want, I would be wary of it.
Thank you for your quick reply.
There goes my hope that something like this is included. I generally try to stay away from plugins, so I will look around a bit more. Maybe there is a nice hack out there.