I’m new to Zola and I’ve done a lot of reading and it seems like there is no way to create a custom variable for something like an image or author. This is my work around, but I need someones help. I’ve almost got it, but not quit there yet.
In the YAML section I have description, and within that description I can put author, picture.jpg, description, or whatever I want. It’s just a string. So I do this…
+++
title = “My cool page”
description =“picture.jpg~Author Name~My super cool description goes here”
+++
Now on my html page where I want this to display I do this:{{ “picture.jpg~John Doe~This is my description” | split(pat="~") }}
This outputs an array with 3 elements
[picture.jpg, John Doe, This is my description]
So far so good! But this is where I’m stuck! How do I reference each element? Like this…
[0] picture.jpg
[1] John Doe
[2] This is my description
The array must have a name and I assume I reference the elements within the array like this: array_name[1]. But I dont know how to do that. Like everything in life, it’s probably super simple, once you know how. I just dont know how.
Eventually I would like to do this:
(that didn’t work, I cant post code)
Thanks in advance!!