From ec2de84f66ae1b76ebe3d764212811422df98dd6 Mon Sep 17 00:00:00 2001
From: curben <2809763-curben@users.noreply.gitlab.com>
Date: Sun, 25 Aug 2019 19:09:26 +0930
Subject: [PATCH] fix(cloudinary): use similar resolutions in typing.css
---
scripts/cloudinary.js | 69 ++++++++++++++++---------------------------
1 file changed, 25 insertions(+), 44 deletions(-)
diff --git a/scripts/cloudinary.js b/scripts/cloudinary.js
index 2098938..a369816 100644
--- a/scripts/cloudinary.js
+++ b/scripts/cloudinary.js
@@ -15,7 +15,7 @@ hexo.extend.tag.register('cloudinary', (args) => {
let modern = ''
let legacy = ''
const cloudinary = 'https://res.cloudinary.com/' + user +
- '/image/upload/f_auto,q_auto/c_limit,'
+ '/image/upload/f_auto,q_auto'
if (fileName.endsWith('.png')) {
modern = fileName.replace(/\.png$/, '.webp')
@@ -23,57 +23,38 @@ hexo.extend.tag.register('cloudinary', (args) => {
} else if (fileName.endsWith('.webp')) {
modern = fileName
legacy = fileName.replace(/\.webp$/, '.gif')
+ } else {
+ legacy = fileName
}
+ const img = `
+ src="${cloudinary}w_768/${legacy}"
+ alt="${alt}">`
+
if (fileName.endsWith('.png') || fileName.endsWith('.webp')) {
return `
`
} else {
return `
-
- `
+ ${img}`
}
})