Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Updated Unsplash image selector to insert larger images
Browse files Browse the repository at this point in the history
no issue

- the default "regular" url Unsplash provides is 1080px wide that does not work well for full-width image cards
- updated to grab 2000px wide images
  • Loading branch information
kevinansfield committed Aug 29, 2019
1 parent eb4ff95 commit aef588c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/components/gh-unsplash-photo.js
Expand Up @@ -40,7 +40,7 @@ export default Component.extend({
imageUrl: computed('photo.urls.regular', function () {
let url = this.get('photo.urls.regular');

url = url.replace(/&w=1080/, '&w=1200');
url = url.replace('&w=1080', '&w=1200');

return url;
}),
Expand Down
2 changes: 1 addition & 1 deletion app/components/gh-unsplash.js
Expand Up @@ -78,7 +78,7 @@ export default Component.extend(ShortcutsMixin, {
this.unsplash.triggerDownload(photo);

let selectParams = {
src: photo.urls.regular,
src: photo.urls.regular.replace(/&w=1080/, '&w=2000'),
alt: photo.description || '',
caption: `Photo by <a href="${photo.user.links.html}?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit">${photo.user.name}</a> / <a href="https://unsplash.com/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit">Unsplash</a>`
};
Expand Down

0 comments on commit aef588c

Please sign in to comment.