February 26th, 2019 - 2 min read
There are many sources you could use to find your next hero image but for me Unsplash.com is working perfectly.
The images are free to use for commercial and non-commercial use. No attribution required but it's recommended to credit the photographer so he's getting more exposure to his work.
One way to find an image is go to Unsplash.com and use the search field. Once you've found a picture you like - click to preview it.
Then copy the id part of the url (letters at the end of the url) and create the following url https://source.unsplash.com/YZQPCI2uMdQ from the following url
https://unsplash.com/photos/**YZQPCI2uMdQ** - starting with
After loading the source you'll get a url like https://images.unsplash.com/photo-1544191901-48602f31b07d?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjF9 that you can now use in Contentful as a url.
You could also download it and add it as file but I think the above mentioned way is easier to do.
To avoid writing the url you could also generate a link in your browser with the following script as url to generate the url for you
There are more options you could use from the source api from Unsplash. Visit https://source.unsplash.com/ to get an idea of the possibiltities.
Also adding a size option as last url part can be useful by simply adding
/400x300 you can request an image with a reduced size of 400px width and 300px height.
It's also OK to use https://source.unsplash.com/collection/
If you're adding a bookmark in your browser maybe you have to navigate away from the loaded image so another click will load a different image or you could add a small script to the link url so the browser won't cache the request - something like
?1551267961 part will be ignored by unsplash api because it's invalid but the browser will always load a new image with-out caching because at every click you're generating a new url.