gatsby-transformer-cloudinary
Advanced tools
Comparing version
@@ -174,3 +174,10 @@ const axios = require('axios'); | ||
const srcSet = breakpoints | ||
const cleaned = breakpoints | ||
.concat(max) // make sure we get the max size | ||
.filter(w => w <= max) // don’t add larger sizes | ||
.sort((a, b) => a - b); // sort in ascending order | ||
const deduped = [...new Set(cleaned)]; | ||
const srcSet = deduped | ||
.map(breakpointWidth => { | ||
@@ -177,0 +184,0 @@ // Get URL for each image including user-defined transformations. |
{ | ||
"name": "gatsby-transformer-cloudinary", | ||
"version": "0.1.2", | ||
"version": "0.3.0", | ||
"description": "Transform local files into Cloudinary-managed assets for Gatsby sites.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,2 +9,4 @@ # gatsby-transformer-cloudinary | ||
> **DISCLAIMER:** If you try running this demo's source code on your own computer, you might face issues as the demo uses assets and [transformations](https://cloudinary.com/documentation/chained_and_named_transformations#named_transformations) from the author’s Cloudinary account. Before running, please remove them or replace them with images and transformations from your own Cloudinary account. | ||
## Install | ||
@@ -11,0 +13,0 @@ |
const cloudinary = require('cloudinary').v2; | ||
const DEFAULT_FLUID_MAX_WIDTH = 650; | ||
const DEFAULT_FLUID_MAX_WIDTH = 5000; | ||
const DEFAULT_FLUID_MIN_WIDTH = 200; | ||
@@ -5,0 +5,0 @@ |
19072
3.43%380
1.33%185
1.09%