Hard-code in a bunch of HTML elements that represent each legend entry
and they will have the images, labels, and descriptions for each entry
all hard-coded in.
This works great... until you need to change something. You did say you are working on a dynamic site, after all.
Put all of that into an easy to read JSON object and iterate over the
could enable, disable, swap-out, have flags, etc for each element.
This is better, but not quite right. What you are looking for is a template for the HTML. You create a simple HTML fragment with the actual data omitted, and your web engine takes a legend entry and puts its data where it goes in the template. Depending on the framework and technology used, you may have static markers in the HTML that are simply replaced by the framework.
The issue with the JSON is it is perhaps a bit too dynamic. Using a static template means you can easily see the layout and modify it, and you still have a single document to modify rather than many.