So I found this thread:
It talks sort of about what I want to do but mine is a bit different.
I want to take a content file and build a template that has a variable number of partials and different color schemes that would be in .data.colors.black or .data.colors.blue etc
I want to create a TOML frontmatter that would look like (note the order would matter)
[[mpartial]]
path='path goes here'
color='black'
other='*'
[[mpartial]]
path='path goes here'
color='blue'
other='*'
other2='*'
Other variables would be things that would be sent to the partial to be used in only that specific partial file. Reason would be if I wanted to call the same partial again, I would want it to have different variables.
The partial would look something like
<table bgcolor={{ .backgroundcolor }}>
<a>{{ .other }}<>
</table>
and finally the data file would look something like
backgroundcolor='#FFFFFF'
foregroundcolor='#000000'
or
backgroundcolor: #FFFFFF
foregroundcolor: #000000
if I did it in yaml (which is slightly easier but not a dealbreaker if I can’t use it)
How would I setup the layout file to do this? how would I range over the first partial, send it’s path to use the partial tell it to use the variables for the color file and also send in the other variables to be used by the partial? Is it possible?
Hopefully someone can help!
Thanks!
Edit: Fixed some things to clear it up.