Your syntax is wrong. image: “{{ readDir “cool-images”|shuffle|first 1}}” You cannot call shuffle along with the readDir function and filtering i.e. first 1 is typically used in tandem with the range function.
You need to see this answer: - First read the directory - Then range through its files - Then use shuffle - Then get the first one
To render the filename: Within the scope of the readDir function - First you will need to construct its PATH - Use the relevant File Variables
These are the steps that you need to follow.
But with the above said, I’m confident that you could achieve your stated objective in a simpler way, like by organizing those images in Page Bundles and then using Hugo’s internal Image Processing methods.