i have following template for each entry on my website
<div class="image-container">
<img src="images/placeholder.png" alt="Image N">
</div>
<div class="entry-content">
<div class="entry-title">EntryName</div>
<div class="entry-rating">Rating: X</div>
<div class="entry-comment">Comment: Lorem ipsum</div>
</div>
</div>
and i want it to automatically fill each image/title/rating/comment from a JSON file.
I would use angular and its for loop to do it but i had problems setting it up on github pages (aswell as nested python scripts).
is there a way to make it work with JS? The entries would be up to 200 entries long
2
Answers
There are probably some complicated ways to do this, and possibly some libraries you would use, but just a simple string template with some tokens to replace works pretty well for something like this.
See the example below.
On github pages I think that you will have to use pure css.
It would look like this :