-
To be honest I'm not sure how to word the question. What I want to do is render an HTML table built using
and then in my liquid template I have The table renders but the liquid is returned raw. {% for city in income %} {% for data in city.data %} {% endfor %} {% endfor %} Anyone know what I'm missing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
LiquidJS in JavaScript is possible, but not exactly easy. You could use the Render plugin and Why not use JavaScript loop? Maybe something like this pseudo code: const tbody = [];
for (const city of metric) {
tbody.push(`<tr><td>${city.city}</td><td>${...}</td></tr>`);
}
return `<table><thead>...</thead>${tbody.join("\n")}</table>`; Will need a bit more tweaking to work with the nested for loop, and passing the correct |
Beta Was this translation helpful? Give feedback.
eleventy.config.js