fix: Array.at() non supporté par Node 14
parent
e3bf770550
commit
b55be6eb78
|
@ -32,10 +32,11 @@ const getLargestImage = (imageMetadata, format) => {
|
||||||
|
|
||||||
const imgHtmlString = (image, imageMetadata) => {
|
const imgHtmlString = (image, imageMetadata) => {
|
||||||
const largestUnoptimizedImg = getLargestImage(imageMetadata, "jpeg");
|
const largestUnoptimizedImg = getLargestImage(imageMetadata, "jpeg");
|
||||||
|
const imagePath = image.split('/')
|
||||||
|
|
||||||
const imgAttributes = stringifyAttributes({
|
const imgAttributes = stringifyAttributes({
|
||||||
src: largestUnoptimizedImg.url,
|
src: largestUnoptimizedImg.url,
|
||||||
alt: image.split('/').at(-1),
|
alt: imagePath[imagePath.length-1],
|
||||||
loading: 'lazy',
|
loading: 'lazy',
|
||||||
decoding: 'async',
|
decoding: 'async',
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue