Random choice of image

Steps to build the URL of a random image

  1. List all images from the images directory
  2. Choose a random image in the list
  3. Extract its URL
It gives the following expression:
<a href="random.jpg" py:attr="random.choice(directory.list(path='Gallery', type='image')).url">Random Image</a>