fix(cloudinary): <noscript> should have class attribute

This commit is contained in:
curben 2019-08-30 06:29:19 +01:00
parent 1b29dac14b
commit bde71fd644
No known key found for this signature in database
GPG Key ID: 5D9DB57A25D34EE3
1 changed files with 3 additions and 2 deletions

View File

@ -44,6 +44,7 @@ hexo.extend.tag.register('cloudinary', (args) => {
if (fileName.endsWith('.png') || fileName.endsWith('.webp')) { if (fileName.endsWith('.png') || fileName.endsWith('.webp')) {
return `<a href="${legacyLink}"> return `<a href="${legacyLink}">
<picture> <picture>
<noscript class="loading-lazy">
<source type="image/webp" <source type="image/webp"
srcset="${modernLink}&w=320 320w, srcset="${modernLink}&w=320 320w,
${modernLink}&w=468 468w, ${modernLink}&w=468 468w,
@ -54,8 +55,8 @@ hexo.extend.tag.register('cloudinary', (args) => {
(max-width: 768px) 768px, (max-width: 768px) 768px,
800px"> 800px">
${img} ${img}
</picture></a>` </noscript></picture></a>`
} else { } else {
return `<a href="${legacyLink}">${img}</a>` return `<a href="${legacyLink}"><noscript class="loading-lazy">${img}</noscript></a>`
} }
}) })