Random choice of image
Steps to build the URL of a random image
- List all images from the images directory
- Choose a random image in the list
- Extract its URL
<a href="random.jpg" py:attr="random.choice(directory.list(path='Gallery', type='image')).url">Random Image</a>