From bb5b0fdd392a1855a9a12341cd147c2fe310d858 Mon Sep 17 00:00:00 2001 From: curben <2809763-curben@users.noreply.gitlab.com> Date: Sun, 25 Aug 2019 17:23:29 +0930 Subject: [PATCH] docs(cloudinary): set username as a variable --- scripts/cloudinary.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/cloudinary.js b/scripts/cloudinary.js index 97f5150..cceddbd 100644 --- a/scripts/cloudinary.js +++ b/scripts/cloudinary.js @@ -3,20 +3,19 @@ /* * Put {% cloudinary 'folder/filename.jpg' 'description' %} in your post. -* Change the username in data-src tag -* and cloud name in typing.js +* Change the username in 'user' variable * More info: -* https://hexo.io/docs/tag-plugins -* https://hexo.io/api/tag -* https://cloudinary.com/documentation/responsive_images +* https://cloudinary.com/blog/responsive_images_with_srcset_sizes_and_cloudinary */ hexo.extend.tag.register('cloudinary', (args) => { + const user = 'curben' const fileName = args[0] const alt = args[1] || '' let modern = '' let legacy = '' - const cloudinary = 'https://res.cloudinary.com/curben/image/upload/w_auto,f_auto,q_auto,c_scale/c_limit,' + const cloudinary = 'https://res.cloudinary.com/' + user + + '/image/upload/w_auto,f_auto,q_auto,c_scale/c_limit,' if (fileName.endsWith('.png')) { modern = fileName.replace(/\.png$/, '.webp')